Commit 69f00660 authored by andersca@apple.com's avatar andersca@apple.com

VectorBuffer::swap doesn't need to use std::swap_ranges

https://bugs.webkit.org/show_bug.cgi?id=121164

Reviewed by Darin Adler.

There's a std::swap overload for swapping arrays, just use it instead.

* wtf/Vector.h:
(WTF::VectorBuffer::swap):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 96e736c6
2013-09-11 Anders Carlsson <andersca@apple.com>
VectorBuffer::swap doesn't need to use std::swap_ranges
https://bugs.webkit.org/show_bug.cgi?id=121164
Reviewed by Darin Adler.
There's a std::swap overload for swapping arrays, just use it instead.
* wtf/Vector.h:
(WTF::VectorBuffer::swap):
2013-09-11 Anders Carlsson <andersca@apple.com>
Implement Vector::append for move-only types
......
......@@ -458,17 +458,17 @@ public:
void swap(VectorBuffer& other)
{
if (buffer() == inlineBuffer() && other.buffer() == other.inlineBuffer()) {
std::swap_ranges(m_inlineBuffer, m_inlineBuffer + inlineCapacity, other.m_inlineBuffer);
std::swap(m_inlineBuffer, other.m_inlineBuffer);
std::swap(m_capacity, other.m_capacity);
} else if (buffer() == inlineBuffer()) {
m_buffer = other.m_buffer;
other.m_buffer = other.inlineBuffer();
std::swap_ranges(m_inlineBuffer, m_inlineBuffer + inlineCapacity, other.m_inlineBuffer);
std::swap(m_inlineBuffer, other.m_inlineBuffer);
std::swap(m_capacity, other.m_capacity);
} else if (other.buffer() == other.inlineBuffer()) {
other.m_buffer = m_buffer;
m_buffer = inlineBuffer();
std::swap_ranges(m_inlineBuffer, m_inlineBuffer + inlineCapacity, other.m_inlineBuffer);
std::swap(m_inlineBuffer, other.m_inlineBuffer);
std::swap(m_capacity, other.m_capacity);
} else {
std::swap(m_buffer, other.m_buffer);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment