<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[180055] trunk/Source/WTF</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/180055">180055</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-02-13 10:05:46 -0800 (Fri, 13 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Re-indent Deque.h
Rubber-stamped by Antti Koivisto.
* wtf/Deque.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfDequeh">trunk/Source/WTF/wtf/Deque.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (180054 => 180055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2015-02-13 17:50:15 UTC (rev 180054)
+++ trunk/Source/WTF/ChangeLog        2015-02-13 18:05:46 UTC (rev 180055)
</span><span class="lines">@@ -1,3 +1,11 @@
</span><ins>+2015-02-13 Anders Carlsson <andersca@apple.com>
+
+ Re-indent Deque.h
+
+ Rubber-stamped by Antti Koivisto.
+
+ * wtf/Deque.h:
+
</ins><span class="cx"> 2015-02-11 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [Win] [64-bit] Work around MSVC2013 Runtime Bug
</span></span></pre></div>
<a id="trunkSourceWTFwtfDequeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Deque.h (180054 => 180055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Deque.h        2015-02-13 17:50:15 UTC (rev 180054)
+++ trunk/Source/WTF/wtf/Deque.h        2015-02-13 18:05:46 UTC (rev 180055)
</span><span class="lines">@@ -38,621 +38,621 @@
</span><span class="cx">
</span><span class="cx"> namespace WTF {
</span><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity> class DequeIteratorBase;
- template<typename T, size_t inlineCapacity> class DequeIterator;
- template<typename T, size_t inlineCapacity> class DequeConstIterator;
</del><ins>+template<typename T, size_t inlineCapacity> class DequeIteratorBase;
+template<typename T, size_t inlineCapacity> class DequeIterator;
+template<typename T, size_t inlineCapacity> class DequeConstIterator;
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity = 0>
- class Deque {
- WTF_MAKE_FAST_ALLOCATED;
- public:
- typedef DequeIterator<T, inlineCapacity> iterator;
- typedef DequeConstIterator<T, inlineCapacity> const_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
</del><ins>+template<typename T, size_t inlineCapacity = 0>
+class Deque {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ typedef DequeIterator<T, inlineCapacity> iterator;
+ typedef DequeConstIterator<T, inlineCapacity> const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
</ins><span class="cx">
</span><del>- Deque();
- Deque(const Deque<T, inlineCapacity>&);
- Deque& operator=(const Deque<T, inlineCapacity>&);
- ~Deque();
</del><ins>+ Deque();
+ Deque(const Deque<T, inlineCapacity>&);
+ Deque& operator=(const Deque<T, inlineCapacity>&);
+ ~Deque();
</ins><span class="cx">
</span><del>- void swap(Deque<T, inlineCapacity>&);
</del><ins>+ void swap(Deque<T, inlineCapacity>&);
</ins><span class="cx">
</span><del>- size_t size() const { return m_start <= m_end ? m_end - m_start : m_end + m_buffer.capacity() - m_start; }
- bool isEmpty() const { return m_start == m_end; }
</del><ins>+ size_t size() const { return m_start <= m_end ? m_end - m_start : m_end + m_buffer.capacity() - m_start; }
+ bool isEmpty() const { return m_start == m_end; }
</ins><span class="cx">
</span><del>- iterator begin() { return iterator(this, m_start); }
- iterator end() { return iterator(this, m_end); }
- const_iterator begin() const { return const_iterator(this, m_start); }
- const_iterator end() const { return const_iterator(this, m_end); }
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
</del><ins>+ iterator begin() { return iterator(this, m_start); }
+ iterator end() { return iterator(this, m_end); }
+ const_iterator begin() const { return const_iterator(this, m_start); }
+ const_iterator end() const { return const_iterator(this, m_end); }
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
</ins><span class="cx">
</span><del>- T& first() { ASSERT(m_start != m_end); return m_buffer.buffer()[m_start]; }
- const T& first() const { ASSERT(m_start != m_end); return m_buffer.buffer()[m_start]; }
- T takeFirst();
</del><ins>+ T& first() { ASSERT(m_start != m_end); return m_buffer.buffer()[m_start]; }
+ const T& first() const { ASSERT(m_start != m_end); return m_buffer.buffer()[m_start]; }
+ T takeFirst();
</ins><span class="cx">
</span><del>- T& last() { ASSERT(m_start != m_end); return *(--end()); }
- const T& last() const { ASSERT(m_start != m_end); return *(--end()); }
- T takeLast();
</del><ins>+ T& last() { ASSERT(m_start != m_end); return *(--end()); }
+ const T& last() const { ASSERT(m_start != m_end); return *(--end()); }
+ T takeLast();
</ins><span class="cx">
</span><del>- template<typename U> void append(U&&);
- template<typename U> void prepend(U&&);
- void removeFirst();
- void removeLast();
- void remove(iterator&);
- void remove(const_iterator&);
</del><ins>+ template<typename U> void append(U&&);
+ template<typename U> void prepend(U&&);
+ void removeFirst();
+ void removeLast();
+ void remove(iterator&);
+ void remove(const_iterator&);
</ins><span class="cx">
</span><del>- void clear();
</del><ins>+ void clear();
</ins><span class="cx">
</span><del>- template<typename Predicate>
- iterator findIf(Predicate&&);
</del><ins>+ template<typename Predicate>
+ iterator findIf(Predicate&&);
</ins><span class="cx">
</span><del>- private:
- friend class DequeIteratorBase<T, inlineCapacity>;
</del><ins>+private:
+ friend class DequeIteratorBase<T, inlineCapacity>;
</ins><span class="cx">
</span><del>- typedef VectorBuffer<T, inlineCapacity> Buffer;
- typedef VectorTypeOperations<T> TypeOperations;
- typedef DequeIteratorBase<T, inlineCapacity> IteratorBase;
</del><ins>+ typedef VectorBuffer<T, inlineCapacity> Buffer;
+ typedef VectorTypeOperations<T> TypeOperations;
+ typedef DequeIteratorBase<T, inlineCapacity> IteratorBase;
</ins><span class="cx">
</span><del>- void remove(size_t position);
- void invalidateIterators();
- void destroyAll();
- void checkValidity() const;
- void checkIndexValidity(size_t) const;
- void expandCapacityIfNeeded();
- void expandCapacity();
</del><ins>+ void remove(size_t position);
+ void invalidateIterators();
+ void destroyAll();
+ void checkValidity() const;
+ void checkIndexValidity(size_t) const;
+ void expandCapacityIfNeeded();
+ void expandCapacity();
</ins><span class="cx">
</span><del>- size_t m_start;
- size_t m_end;
- Buffer m_buffer;
</del><ins>+ size_t m_start;
+ size_t m_end;
+ Buffer m_buffer;
</ins><span class="cx"> #ifndef NDEBUG
</span><del>- mutable IteratorBase* m_iterators;
</del><ins>+ mutable IteratorBase* m_iterators;
</ins><span class="cx"> #endif
</span><del>- };
</del><ins>+};
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity = 0>
- class DequeIteratorBase {
- protected:
- DequeIteratorBase();
- DequeIteratorBase(const Deque<T, inlineCapacity>*, size_t);
- DequeIteratorBase(const DequeIteratorBase&);
- DequeIteratorBase& operator=(const DequeIteratorBase&);
- ~DequeIteratorBase();
</del><ins>+template<typename T, size_t inlineCapacity = 0>
+class DequeIteratorBase {
+protected:
+ DequeIteratorBase();
+ DequeIteratorBase(const Deque<T, inlineCapacity>*, size_t);
+ DequeIteratorBase(const DequeIteratorBase&);
+ DequeIteratorBase& operator=(const DequeIteratorBase&);
+ ~DequeIteratorBase();
</ins><span class="cx">
</span><del>- void assign(const DequeIteratorBase& other) { *this = other; }
</del><ins>+ void assign(const DequeIteratorBase& other) { *this = other; }
</ins><span class="cx">
</span><del>- void increment();
- void decrement();
</del><ins>+ void increment();
+ void decrement();
</ins><span class="cx">
</span><del>- T* before() const;
- T* after() const;
</del><ins>+ T* before() const;
+ T* after() const;
</ins><span class="cx">
</span><del>- bool isEqual(const DequeIteratorBase&) const;
</del><ins>+ bool isEqual(const DequeIteratorBase&) const;
</ins><span class="cx">
</span><del>- private:
- void addToIteratorsList();
- void removeFromIteratorsList();
- void checkValidity() const;
- void checkValidity(const DequeIteratorBase&) const;
</del><ins>+private:
+ void addToIteratorsList();
+ void removeFromIteratorsList();
+ void checkValidity() const;
+ void checkValidity(const DequeIteratorBase&) const;
</ins><span class="cx">
</span><del>- Deque<T, inlineCapacity>* m_deque;
- size_t m_index;
</del><ins>+ Deque<T, inlineCapacity>* m_deque;
+ size_t m_index;
</ins><span class="cx">
</span><del>- friend class Deque<T, inlineCapacity>;
</del><ins>+ friend class Deque<T, inlineCapacity>;
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><del>- mutable DequeIteratorBase* m_next;
- mutable DequeIteratorBase* m_previous;
</del><ins>+ mutable DequeIteratorBase* m_next;
+ mutable DequeIteratorBase* m_previous;
</ins><span class="cx"> #endif
</span><del>- };
</del><ins>+};
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity = 0>
- class DequeIterator : public DequeIteratorBase<T, inlineCapacity> {
- private:
- typedef DequeIteratorBase<T, inlineCapacity> Base;
- typedef DequeIterator<T, inlineCapacity> Iterator;
</del><ins>+template<typename T, size_t inlineCapacity = 0>
+class DequeIterator : public DequeIteratorBase<T, inlineCapacity> {
+private:
+ typedef DequeIteratorBase<T, inlineCapacity> Base;
+ typedef DequeIterator<T, inlineCapacity> Iterator;
</ins><span class="cx">
</span><del>- public:
- typedef ptrdiff_t difference_type;
- typedef T value_type;
- typedef T* pointer;
- typedef T& reference;
- typedef std::bidirectional_iterator_tag iterator_category;
</del><ins>+public:
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef T* pointer;
+ typedef T& reference;
+ typedef std::bidirectional_iterator_tag iterator_category;
</ins><span class="cx">
</span><del>- DequeIterator(Deque<T, inlineCapacity>* deque, size_t index)
- : Base(deque, index) { }
</del><ins>+ DequeIterator(Deque<T, inlineCapacity>* deque, size_t index)
+ : Base(deque, index) { }
</ins><span class="cx">
</span><del>- DequeIterator(const Iterator& other) : Base(other) { }
- DequeIterator& operator=(const Iterator& other) { Base::assign(other); return *this; }
</del><ins>+ DequeIterator(const Iterator& other) : Base(other) { }
+ DequeIterator& operator=(const Iterator& other) { Base::assign(other); return *this; }
</ins><span class="cx">
</span><del>- T& operator*() const { return *Base::after(); }
- T* operator->() const { return Base::after(); }
</del><ins>+ T& operator*() const { return *Base::after(); }
+ T* operator->() const { return Base::after(); }
</ins><span class="cx">
</span><del>- bool operator==(const Iterator& other) const { return Base::isEqual(other); }
- bool operator!=(const Iterator& other) const { return !Base::isEqual(other); }
</del><ins>+ bool operator==(const Iterator& other) const { return Base::isEqual(other); }
+ bool operator!=(const Iterator& other) const { return !Base::isEqual(other); }
</ins><span class="cx">
</span><del>- Iterator& operator++() { Base::increment(); return *this; }
- // postfix ++ intentionally omitted
- Iterator& operator--() { Base::decrement(); return *this; }
- // postfix -- intentionally omitted
- };
</del><ins>+ Iterator& operator++() { Base::increment(); return *this; }
+ // postfix ++ intentionally omitted
+ Iterator& operator--() { Base::decrement(); return *this; }
+ // postfix -- intentionally omitted
+};
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity = 0>
- class DequeConstIterator : public DequeIteratorBase<T, inlineCapacity> {
- private:
- typedef DequeIteratorBase<T, inlineCapacity> Base;
- typedef DequeConstIterator<T, inlineCapacity> Iterator;
- typedef DequeIterator<T, inlineCapacity> NonConstIterator;
</del><ins>+template<typename T, size_t inlineCapacity = 0>
+class DequeConstIterator : public DequeIteratorBase<T, inlineCapacity> {
+private:
+ typedef DequeIteratorBase<T, inlineCapacity> Base;
+ typedef DequeConstIterator<T, inlineCapacity> Iterator;
+ typedef DequeIterator<T, inlineCapacity> NonConstIterator;
</ins><span class="cx">
</span><del>- public:
- typedef ptrdiff_t difference_type;
- typedef T value_type;
- typedef const T* pointer;
- typedef const T& reference;
- typedef std::bidirectional_iterator_tag iterator_category;
</del><ins>+public:
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T* pointer;
+ typedef const T& reference;
+ typedef std::bidirectional_iterator_tag iterator_category;
</ins><span class="cx">
</span><del>- DequeConstIterator(const Deque<T, inlineCapacity>* deque, size_t index)
- : Base(deque, index) { }
</del><ins>+ DequeConstIterator(const Deque<T, inlineCapacity>* deque, size_t index)
+ : Base(deque, index) { }
</ins><span class="cx">
</span><del>- DequeConstIterator(const Iterator& other) : Base(other) { }
- DequeConstIterator(const NonConstIterator& other) : Base(other) { }
- DequeConstIterator& operator=(const Iterator& other) { Base::assign(other); return *this; }
- DequeConstIterator& operator=(const NonConstIterator& other) { Base::assign(other); return *this; }
</del><ins>+ DequeConstIterator(const Iterator& other) : Base(other) { }
+ DequeConstIterator(const NonConstIterator& other) : Base(other) { }
+ DequeConstIterator& operator=(const Iterator& other) { Base::assign(other); return *this; }
+ DequeConstIterator& operator=(const NonConstIterator& other) { Base::assign(other); return *this; }
</ins><span class="cx">
</span><del>- const T& operator*() const { return *Base::after(); }
- const T* operator->() const { return Base::after(); }
</del><ins>+ const T& operator*() const { return *Base::after(); }
+ const T* operator->() const { return Base::after(); }
</ins><span class="cx">
</span><del>- bool operator==(const Iterator& other) const { return Base::isEqual(other); }
- bool operator!=(const Iterator& other) const { return !Base::isEqual(other); }
</del><ins>+ bool operator==(const Iterator& other) const { return Base::isEqual(other); }
+ bool operator!=(const Iterator& other) const { return !Base::isEqual(other); }
</ins><span class="cx">
</span><del>- Iterator& operator++() { Base::increment(); return *this; }
- // postfix ++ intentionally omitted
- Iterator& operator--() { Base::decrement(); return *this; }
- // postfix -- intentionally omitted
- };
</del><ins>+ Iterator& operator++() { Base::increment(); return *this; }
+ // postfix ++ intentionally omitted
+ Iterator& operator--() { Base::decrement(); return *this; }
+ // postfix -- intentionally omitted
+};
</ins><span class="cx">
</span><span class="cx"> #ifdef NDEBUG
</span><del>- template<typename T, size_t inlineCapacity> inline void Deque<T, inlineCapacity>::checkValidity() const { }
- template<typename T, size_t inlineCapacity> inline void Deque<T, inlineCapacity>::checkIndexValidity(size_t) const { }
- template<typename T, size_t inlineCapacity> inline void Deque<T, inlineCapacity>::invalidateIterators() { }
</del><ins>+template<typename T, size_t inlineCapacity> inline void Deque<T, inlineCapacity>::checkValidity() const { }
+template<typename T, size_t inlineCapacity> inline void Deque<T, inlineCapacity>::checkIndexValidity(size_t) const { }
+template<typename T, size_t inlineCapacity> inline void Deque<T, inlineCapacity>::invalidateIterators() { }
</ins><span class="cx"> #else
</span><del>- template<typename T, size_t inlineCapacity>
- void Deque<T, inlineCapacity>::checkValidity() const
- {
- // In this implementation a capacity of 1 would confuse append() and
- // other places that assume the index after capacity - 1 is 0.
- ASSERT(m_buffer.capacity() != 1);
</del><ins>+template<typename T, size_t inlineCapacity>
+void Deque<T, inlineCapacity>::checkValidity() const
+{
+ // In this implementation a capacity of 1 would confuse append() and
+ // other places that assume the index after capacity - 1 is 0.
+ ASSERT(m_buffer.capacity() != 1);
</ins><span class="cx">
</span><del>- if (!m_buffer.capacity()) {
- ASSERT(!m_start);
- ASSERT(!m_end);
- } else {
- ASSERT(m_start < m_buffer.capacity());
- ASSERT(m_end < m_buffer.capacity());
- }
</del><ins>+ if (!m_buffer.capacity()) {
+ ASSERT(!m_start);
+ ASSERT(!m_end);
+ } else {
+ ASSERT(m_start < m_buffer.capacity());
+ ASSERT(m_end < m_buffer.capacity());
</ins><span class="cx"> }
</span><ins>+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- void Deque<T, inlineCapacity>::checkIndexValidity(size_t index) const
- {
- ASSERT_UNUSED(index, index <= m_buffer.capacity());
- if (m_start <= m_end) {
- ASSERT(index >= m_start);
- ASSERT(index <= m_end);
- } else {
- ASSERT(index >= m_start || index <= m_end);
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+void Deque<T, inlineCapacity>::checkIndexValidity(size_t index) const
+{
+ ASSERT_UNUSED(index, index <= m_buffer.capacity());
+ if (m_start <= m_end) {
+ ASSERT(index >= m_start);
+ ASSERT(index <= m_end);
+ } else {
+ ASSERT(index >= m_start || index <= m_end);
</ins><span class="cx"> }
</span><ins>+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- void Deque<T, inlineCapacity>::invalidateIterators()
- {
- IteratorBase* next;
- for (IteratorBase* p = m_iterators; p; p = next) {
- next = p->m_next;
- p->m_deque = 0;
- p->m_next = 0;
- p->m_previous = 0;
- }
- m_iterators = 0;
</del><ins>+template<typename T, size_t inlineCapacity>
+void Deque<T, inlineCapacity>::invalidateIterators()
+{
+ IteratorBase* next;
+ for (IteratorBase* p = m_iterators; p; p = next) {
+ next = p->m_next;
+ p->m_deque = 0;
+ p->m_next = 0;
+ p->m_previous = 0;
</ins><span class="cx"> }
</span><ins>+ m_iterators = 0;
+}
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline Deque<T, inlineCapacity>::Deque()
- : m_start(0)
- , m_end(0)
</del><ins>+template<typename T, size_t inlineCapacity>
+inline Deque<T, inlineCapacity>::Deque()
+ : m_start(0)
+ , m_end(0)
</ins><span class="cx"> #ifndef NDEBUG
</span><del>- , m_iterators(0)
</del><ins>+ , m_iterators(0)
</ins><span class="cx"> #endif
</span><del>- {
- checkValidity();
- }
</del><ins>+{
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline Deque<T, inlineCapacity>::Deque(const Deque<T, inlineCapacity>& other)
- : m_start(other.m_start)
- , m_end(other.m_end)
- , m_buffer(other.m_buffer.capacity())
</del><ins>+template<typename T, size_t inlineCapacity>
+inline Deque<T, inlineCapacity>::Deque(const Deque<T, inlineCapacity>& other)
+ : m_start(other.m_start)
+ , m_end(other.m_end)
+ , m_buffer(other.m_buffer.capacity())
</ins><span class="cx"> #ifndef NDEBUG
</span><del>- , m_iterators(0)
</del><ins>+ , m_iterators(0)
</ins><span class="cx"> #endif
</span><del>- {
- const T* otherBuffer = other.m_buffer.buffer();
- if (m_start <= m_end)
- TypeOperations::uninitializedCopy(otherBuffer + m_start, otherBuffer + m_end, m_buffer.buffer() + m_start);
- else {
- TypeOperations::uninitializedCopy(otherBuffer, otherBuffer + m_end, m_buffer.buffer());
- TypeOperations::uninitializedCopy(otherBuffer + m_start, otherBuffer + m_buffer.capacity(), m_buffer.buffer() + m_start);
- }
</del><ins>+{
+ const T* otherBuffer = other.m_buffer.buffer();
+ if (m_start <= m_end)
+ TypeOperations::uninitializedCopy(otherBuffer + m_start, otherBuffer + m_end, m_buffer.buffer() + m_start);
+ else {
+ TypeOperations::uninitializedCopy(otherBuffer, otherBuffer + m_end, m_buffer.buffer());
+ TypeOperations::uninitializedCopy(otherBuffer + m_start, otherBuffer + m_buffer.capacity(), m_buffer.buffer() + m_start);
</ins><span class="cx"> }
</span><ins>+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline Deque<T, inlineCapacity>& Deque<T, inlineCapacity>::operator=(const Deque<T, inlineCapacity>& other)
- {
- // FIXME: This is inefficient if we're using an inline buffer and T is
- // expensive to copy since it will copy the buffer twice instead of once.
- Deque<T, inlineCapacity> copy(other);
- swap(copy);
- return *this;
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline Deque<T, inlineCapacity>& Deque<T, inlineCapacity>::operator=(const Deque<T, inlineCapacity>& other)
+{
+ // FIXME: This is inefficient if we're using an inline buffer and T is
+ // expensive to copy since it will copy the buffer twice instead of once.
+ Deque<T, inlineCapacity> copy(other);
+ swap(copy);
+ return *this;
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void Deque<T, inlineCapacity>::destroyAll()
- {
- if (m_start <= m_end)
- TypeOperations::destruct(m_buffer.buffer() + m_start, m_buffer.buffer() + m_end);
- else {
- TypeOperations::destruct(m_buffer.buffer(), m_buffer.buffer() + m_end);
- TypeOperations::destruct(m_buffer.buffer() + m_start, m_buffer.buffer() + m_buffer.capacity());
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void Deque<T, inlineCapacity>::destroyAll()
+{
+ if (m_start <= m_end)
+ TypeOperations::destruct(m_buffer.buffer() + m_start, m_buffer.buffer() + m_end);
+ else {
+ TypeOperations::destruct(m_buffer.buffer(), m_buffer.buffer() + m_end);
+ TypeOperations::destruct(m_buffer.buffer() + m_start, m_buffer.buffer() + m_buffer.capacity());
</ins><span class="cx"> }
</span><ins>+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline Deque<T, inlineCapacity>::~Deque()
- {
- checkValidity();
- invalidateIterators();
- destroyAll();
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline Deque<T, inlineCapacity>::~Deque()
+{
+ checkValidity();
+ invalidateIterators();
+ destroyAll();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void Deque<T, inlineCapacity>::swap(Deque<T, inlineCapacity>& other)
- {
- checkValidity();
- other.checkValidity();
- invalidateIterators();
- std::swap(m_start, other.m_start);
- std::swap(m_end, other.m_end);
- m_buffer.swap(other.m_buffer, 0, 0);
- checkValidity();
- other.checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void Deque<T, inlineCapacity>::swap(Deque<T, inlineCapacity>& other)
+{
+ checkValidity();
+ other.checkValidity();
+ invalidateIterators();
+ std::swap(m_start, other.m_start);
+ std::swap(m_end, other.m_end);
+ m_buffer.swap(other.m_buffer, 0, 0);
+ checkValidity();
+ other.checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void Deque<T, inlineCapacity>::clear()
- {
- checkValidity();
- invalidateIterators();
- destroyAll();
- m_start = 0;
- m_end = 0;
- m_buffer.deallocateBuffer(m_buffer.buffer());
- checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void Deque<T, inlineCapacity>::clear()
+{
+ checkValidity();
+ invalidateIterators();
+ destroyAll();
+ m_start = 0;
+ m_end = 0;
+ m_buffer.deallocateBuffer(m_buffer.buffer());
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- template<typename Predicate>
- inline auto Deque<T, inlineCapacity>::findIf(Predicate&& predicate) -> iterator
- {
- iterator end_iterator = end();
- for (iterator it = begin(); it != end_iterator; ++it) {
- if (predicate(*it))
- return it;
- }
- return end_iterator;
</del><ins>+template<typename T, size_t inlineCapacity>
+template<typename Predicate>
+inline auto Deque<T, inlineCapacity>::findIf(Predicate&& predicate) -> iterator
+{
+ iterator end_iterator = end();
+ for (iterator it = begin(); it != end_iterator; ++it) {
+ if (predicate(*it))
+ return it;
</ins><span class="cx"> }
</span><ins>+ return end_iterator;
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void Deque<T, inlineCapacity>::expandCapacityIfNeeded()
- {
- if (m_start) {
- if (m_end + 1 != m_start)
- return;
- } else if (m_end) {
- if (m_end != m_buffer.capacity() - 1)
- return;
- } else if (m_buffer.capacity())
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void Deque<T, inlineCapacity>::expandCapacityIfNeeded()
+{
+ if (m_start) {
+ if (m_end + 1 != m_start)
</ins><span class="cx"> return;
</span><ins>+ } else if (m_end) {
+ if (m_end != m_buffer.capacity() - 1)
+ return;
+ } else if (m_buffer.capacity())
+ return;
</ins><span class="cx">
</span><del>- expandCapacity();
- }
</del><ins>+ expandCapacity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- void Deque<T, inlineCapacity>::expandCapacity()
- {
- checkValidity();
- size_t oldCapacity = m_buffer.capacity();
- T* oldBuffer = m_buffer.buffer();
- m_buffer.allocateBuffer(std::max(static_cast<size_t>(16), oldCapacity + oldCapacity / 4 + 1));
- if (m_start <= m_end)
- TypeOperations::move(oldBuffer + m_start, oldBuffer + m_end, m_buffer.buffer() + m_start);
- else {
- TypeOperations::move(oldBuffer, oldBuffer + m_end, m_buffer.buffer());
- size_t newStart = m_buffer.capacity() - (oldCapacity - m_start);
- TypeOperations::move(oldBuffer + m_start, oldBuffer + oldCapacity, m_buffer.buffer() + newStart);
- m_start = newStart;
- }
- m_buffer.deallocateBuffer(oldBuffer);
- checkValidity();
</del><ins>+template<typename T, size_t inlineCapacity>
+void Deque<T, inlineCapacity>::expandCapacity()
+{
+ checkValidity();
+ size_t oldCapacity = m_buffer.capacity();
+ T* oldBuffer = m_buffer.buffer();
+ m_buffer.allocateBuffer(std::max(static_cast<size_t>(16), oldCapacity + oldCapacity / 4 + 1));
+ if (m_start <= m_end)
+ TypeOperations::move(oldBuffer + m_start, oldBuffer + m_end, m_buffer.buffer() + m_start);
+ else {
+ TypeOperations::move(oldBuffer, oldBuffer + m_end, m_buffer.buffer());
+ size_t newStart = m_buffer.capacity() - (oldCapacity - m_start);
+ TypeOperations::move(oldBuffer + m_start, oldBuffer + oldCapacity, m_buffer.buffer() + newStart);
+ m_start = newStart;
</ins><span class="cx"> }
</span><ins>+ m_buffer.deallocateBuffer(oldBuffer);
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline auto Deque<T, inlineCapacity>::takeFirst() -> T
- {
- T oldFirst = WTF::move(first());
- removeFirst();
- return oldFirst;
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline auto Deque<T, inlineCapacity>::takeFirst() -> T
+{
+ T oldFirst = WTF::move(first());
+ removeFirst();
+ return oldFirst;
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline auto Deque<T, inlineCapacity>::takeLast() -> T
- {
- T oldLast = WTF::move(last());
- removeLast();
- return oldLast;
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline auto Deque<T, inlineCapacity>::takeLast() -> T
+{
+ T oldLast = WTF::move(last());
+ removeLast();
+ return oldLast;
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity> template<typename U>
- inline void Deque<T, inlineCapacity>::append(U&& value)
- {
- checkValidity();
- expandCapacityIfNeeded();
- new (NotNull, std::addressof(m_buffer.buffer()[m_end])) T(std::forward<U>(value));
- if (m_end == m_buffer.capacity() - 1)
- m_end = 0;
- else
- ++m_end;
- checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity> template<typename U>
+inline void Deque<T, inlineCapacity>::append(U&& value)
+{
+ checkValidity();
+ expandCapacityIfNeeded();
+ new (NotNull, std::addressof(m_buffer.buffer()[m_end])) T(std::forward<U>(value));
+ if (m_end == m_buffer.capacity() - 1)
+ m_end = 0;
+ else
+ ++m_end;
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity> template<typename U>
- inline void Deque<T, inlineCapacity>::prepend(U&& value)
- {
- checkValidity();
- expandCapacityIfNeeded();
- if (!m_start)
- m_start = m_buffer.capacity() - 1;
- else
- --m_start;
- new (NotNull, std::addressof(m_buffer.buffer()[m_start])) T(std::forward<U>(value));
- checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity> template<typename U>
+inline void Deque<T, inlineCapacity>::prepend(U&& value)
+{
+ checkValidity();
+ expandCapacityIfNeeded();
+ if (!m_start)
+ m_start = m_buffer.capacity() - 1;
+ else
+ --m_start;
+ new (NotNull, std::addressof(m_buffer.buffer()[m_start])) T(std::forward<U>(value));
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void Deque<T, inlineCapacity>::removeFirst()
- {
- checkValidity();
- invalidateIterators();
- ASSERT(!isEmpty());
- TypeOperations::destruct(std::addressof(m_buffer.buffer()[m_start]), std::addressof(m_buffer.buffer()[m_start + 1]));
- if (m_start == m_buffer.capacity() - 1)
- m_start = 0;
- else
- ++m_start;
- checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void Deque<T, inlineCapacity>::removeFirst()
+{
+ checkValidity();
+ invalidateIterators();
+ ASSERT(!isEmpty());
+ TypeOperations::destruct(std::addressof(m_buffer.buffer()[m_start]), std::addressof(m_buffer.buffer()[m_start + 1]));
+ if (m_start == m_buffer.capacity() - 1)
+ m_start = 0;
+ else
+ ++m_start;
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void Deque<T, inlineCapacity>::removeLast()
- {
- checkValidity();
- invalidateIterators();
- ASSERT(!isEmpty());
- if (!m_end)
- m_end = m_buffer.capacity() - 1;
- else
- --m_end;
- TypeOperations::destruct(std::addressof(m_buffer.buffer()[m_end]), std::addressof(m_buffer.buffer()[m_end + 1]));
- checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void Deque<T, inlineCapacity>::removeLast()
+{
+ checkValidity();
+ invalidateIterators();
+ ASSERT(!isEmpty());
+ if (!m_end)
+ m_end = m_buffer.capacity() - 1;
+ else
+ --m_end;
+ TypeOperations::destruct(std::addressof(m_buffer.buffer()[m_end]), std::addressof(m_buffer.buffer()[m_end + 1]));
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void Deque<T, inlineCapacity>::remove(iterator& it)
- {
- it.checkValidity();
- remove(it.m_index);
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void Deque<T, inlineCapacity>::remove(iterator& it)
+{
+ it.checkValidity();
+ remove(it.m_index);
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void Deque<T, inlineCapacity>::remove(const_iterator& it)
- {
- it.checkValidity();
- remove(it.m_index);
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void Deque<T, inlineCapacity>::remove(const_iterator& it)
+{
+ it.checkValidity();
+ remove(it.m_index);
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void Deque<T, inlineCapacity>::remove(size_t position)
- {
- if (position == m_end)
- return;
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void Deque<T, inlineCapacity>::remove(size_t position)
+{
+ if (position == m_end)
+ return;
</ins><span class="cx">
</span><del>- checkValidity();
- invalidateIterators();
</del><ins>+ checkValidity();
+ invalidateIterators();
</ins><span class="cx">
</span><del>- T* buffer = m_buffer.buffer();
- TypeOperations::destruct(std::addressof(buffer[position]), std::addressof(buffer[position + 1]));
</del><ins>+ T* buffer = m_buffer.buffer();
+ TypeOperations::destruct(std::addressof(buffer[position]), std::addressof(buffer[position + 1]));
</ins><span class="cx">
</span><del>- // Find which segment of the circular buffer contained the remove element, and only move elements in that part.
- if (position >= m_start) {
- TypeOperations::moveOverlapping(buffer + m_start, buffer + position, buffer + m_start + 1);
- m_start = (m_start + 1) % m_buffer.capacity();
- } else {
- TypeOperations::moveOverlapping(buffer + position + 1, buffer + m_end, buffer + position);
- m_end = (m_end - 1 + m_buffer.capacity()) % m_buffer.capacity();
- }
- checkValidity();
</del><ins>+ // Find which segment of the circular buffer contained the remove element, and only move elements in that part.
+ if (position >= m_start) {
+ TypeOperations::moveOverlapping(buffer + m_start, buffer + position, buffer + m_start + 1);
+ m_start = (m_start + 1) % m_buffer.capacity();
+ } else {
+ TypeOperations::moveOverlapping(buffer + position + 1, buffer + m_end, buffer + position);
+ m_end = (m_end - 1 + m_buffer.capacity()) % m_buffer.capacity();
</ins><span class="cx"> }
</span><ins>+ checkValidity();
+}
</ins><span class="cx">
</span><span class="cx"> #ifdef NDEBUG
</span><del>- template<typename T, size_t inlineCapacity> inline void DequeIteratorBase<T, inlineCapacity>::checkValidity() const { }
- template<typename T, size_t inlineCapacity> inline void DequeIteratorBase<T, inlineCapacity>::checkValidity(const DequeIteratorBase<T, inlineCapacity>&) const { }
- template<typename T, size_t inlineCapacity> inline void DequeIteratorBase<T, inlineCapacity>::addToIteratorsList() { }
- template<typename T, size_t inlineCapacity> inline void DequeIteratorBase<T, inlineCapacity>::removeFromIteratorsList() { }
</del><ins>+template<typename T, size_t inlineCapacity> inline void DequeIteratorBase<T, inlineCapacity>::checkValidity() const { }
+template<typename T, size_t inlineCapacity> inline void DequeIteratorBase<T, inlineCapacity>::checkValidity(const DequeIteratorBase<T, inlineCapacity>&) const { }
+template<typename T, size_t inlineCapacity> inline void DequeIteratorBase<T, inlineCapacity>::addToIteratorsList() { }
+template<typename T, size_t inlineCapacity> inline void DequeIteratorBase<T, inlineCapacity>::removeFromIteratorsList() { }
</ins><span class="cx"> #else
</span><del>- template<typename T, size_t inlineCapacity>
- void DequeIteratorBase<T, inlineCapacity>::checkValidity() const
- {
- ASSERT(m_deque);
- m_deque->checkIndexValidity(m_index);
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+void DequeIteratorBase<T, inlineCapacity>::checkValidity() const
+{
+ ASSERT(m_deque);
+ m_deque->checkIndexValidity(m_index);
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- void DequeIteratorBase<T, inlineCapacity>::checkValidity(const DequeIteratorBase& other) const
- {
- checkValidity();
- other.checkValidity();
- ASSERT(m_deque == other.m_deque);
</del><ins>+template<typename T, size_t inlineCapacity>
+void DequeIteratorBase<T, inlineCapacity>::checkValidity(const DequeIteratorBase& other) const
+{
+ checkValidity();
+ other.checkValidity();
+ ASSERT(m_deque == other.m_deque);
+}
+
+template<typename T, size_t inlineCapacity>
+void DequeIteratorBase<T, inlineCapacity>::addToIteratorsList()
+{
+ if (!m_deque)
+ m_next = 0;
+ else {
+ m_next = m_deque->m_iterators;
+ m_deque->m_iterators = this;
+ if (m_next)
+ m_next->m_previous = this;
</ins><span class="cx"> }
</span><ins>+ m_previous = 0;
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- void DequeIteratorBase<T, inlineCapacity>::addToIteratorsList()
- {
- if (!m_deque)
- m_next = 0;
- else {
- m_next = m_deque->m_iterators;
- m_deque->m_iterators = this;
- if (m_next)
- m_next->m_previous = this;
</del><ins>+template<typename T, size_t inlineCapacity>
+void DequeIteratorBase<T, inlineCapacity>::removeFromIteratorsList()
+{
+ if (!m_deque) {
+ ASSERT(!m_next);
+ ASSERT(!m_previous);
+ } else {
+ if (m_next) {
+ ASSERT(m_next->m_previous == this);
+ m_next->m_previous = m_previous;
</ins><span class="cx"> }
</span><del>- m_previous = 0;
- }
-
- template<typename T, size_t inlineCapacity>
- void DequeIteratorBase<T, inlineCapacity>::removeFromIteratorsList()
- {
- if (!m_deque) {
- ASSERT(!m_next);
- ASSERT(!m_previous);
</del><ins>+ if (m_previous) {
+ ASSERT(m_deque->m_iterators != this);
+ ASSERT(m_previous->m_next == this);
+ m_previous->m_next = m_next;
</ins><span class="cx"> } else {
</span><del>- if (m_next) {
- ASSERT(m_next->m_previous == this);
- m_next->m_previous = m_previous;
- }
- if (m_previous) {
- ASSERT(m_deque->m_iterators != this);
- ASSERT(m_previous->m_next == this);
- m_previous->m_next = m_next;
- } else {
- ASSERT(m_deque->m_iterators == this);
- m_deque->m_iterators = m_next;
- }
</del><ins>+ ASSERT(m_deque->m_iterators == this);
+ m_deque->m_iterators = m_next;
</ins><span class="cx"> }
</span><del>- m_next = 0;
- m_previous = 0;
</del><span class="cx"> }
</span><ins>+ m_next = 0;
+ m_previous = 0;
+}
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline DequeIteratorBase<T, inlineCapacity>::DequeIteratorBase()
- : m_deque(0)
- {
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline DequeIteratorBase<T, inlineCapacity>::DequeIteratorBase()
+ : m_deque(0)
+{
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline DequeIteratorBase<T, inlineCapacity>::DequeIteratorBase(const Deque<T, inlineCapacity>* deque, size_t index)
- : m_deque(const_cast<Deque<T, inlineCapacity>*>(deque))
- , m_index(index)
- {
- addToIteratorsList();
- checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline DequeIteratorBase<T, inlineCapacity>::DequeIteratorBase(const Deque<T, inlineCapacity>* deque, size_t index)
+ : m_deque(const_cast<Deque<T, inlineCapacity>*>(deque))
+ , m_index(index)
+{
+ addToIteratorsList();
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline DequeIteratorBase<T, inlineCapacity>::DequeIteratorBase(const DequeIteratorBase& other)
- : m_deque(other.m_deque)
- , m_index(other.m_index)
- {
- addToIteratorsList();
- checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline DequeIteratorBase<T, inlineCapacity>::DequeIteratorBase(const DequeIteratorBase& other)
+ : m_deque(other.m_deque)
+ , m_index(other.m_index)
+{
+ addToIteratorsList();
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline DequeIteratorBase<T, inlineCapacity>& DequeIteratorBase<T, inlineCapacity>::operator=(const DequeIteratorBase& other)
- {
- other.checkValidity();
- removeFromIteratorsList();
</del><ins>+template<typename T, size_t inlineCapacity>
+inline DequeIteratorBase<T, inlineCapacity>& DequeIteratorBase<T, inlineCapacity>::operator=(const DequeIteratorBase& other)
+{
+ other.checkValidity();
+ removeFromIteratorsList();
</ins><span class="cx">
</span><del>- m_deque = other.m_deque;
- m_index = other.m_index;
- addToIteratorsList();
- checkValidity();
- return *this;
- }
</del><ins>+ m_deque = other.m_deque;
+ m_index = other.m_index;
+ addToIteratorsList();
+ checkValidity();
+ return *this;
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline DequeIteratorBase<T, inlineCapacity>::~DequeIteratorBase()
- {
</del><ins>+template<typename T, size_t inlineCapacity>
+inline DequeIteratorBase<T, inlineCapacity>::~DequeIteratorBase()
+{
</ins><span class="cx"> #ifndef NDEBUG
</span><del>- removeFromIteratorsList();
- m_deque = 0;
</del><ins>+ removeFromIteratorsList();
+ m_deque = 0;
</ins><span class="cx"> #endif
</span><del>- }
</del><ins>+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline bool DequeIteratorBase<T, inlineCapacity>::isEqual(const DequeIteratorBase& other) const
- {
- checkValidity(other);
- return m_index == other.m_index;
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline bool DequeIteratorBase<T, inlineCapacity>::isEqual(const DequeIteratorBase& other) const
+{
+ checkValidity(other);
+ return m_index == other.m_index;
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void DequeIteratorBase<T, inlineCapacity>::increment()
- {
- checkValidity();
- ASSERT(m_index != m_deque->m_end);
- ASSERT(m_deque->m_buffer.capacity());
- if (m_index == m_deque->m_buffer.capacity() - 1)
- m_index = 0;
- else
- ++m_index;
- checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void DequeIteratorBase<T, inlineCapacity>::increment()
+{
+ checkValidity();
+ ASSERT(m_index != m_deque->m_end);
+ ASSERT(m_deque->m_buffer.capacity());
+ if (m_index == m_deque->m_buffer.capacity() - 1)
+ m_index = 0;
+ else
+ ++m_index;
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline void DequeIteratorBase<T, inlineCapacity>::decrement()
- {
- checkValidity();
- ASSERT(m_index != m_deque->m_start);
- ASSERT(m_deque->m_buffer.capacity());
- if (!m_index)
- m_index = m_deque->m_buffer.capacity() - 1;
- else
- --m_index;
- checkValidity();
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline void DequeIteratorBase<T, inlineCapacity>::decrement()
+{
+ checkValidity();
+ ASSERT(m_index != m_deque->m_start);
+ ASSERT(m_deque->m_buffer.capacity());
+ if (!m_index)
+ m_index = m_deque->m_buffer.capacity() - 1;
+ else
+ --m_index;
+ checkValidity();
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline T* DequeIteratorBase<T, inlineCapacity>::after() const
- {
- checkValidity();
- ASSERT(m_index != m_deque->m_end);
- return std::addressof(m_deque->m_buffer.buffer()[m_index]);
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline T* DequeIteratorBase<T, inlineCapacity>::after() const
+{
+ checkValidity();
+ ASSERT(m_index != m_deque->m_end);
+ return std::addressof(m_deque->m_buffer.buffer()[m_index]);
+}
</ins><span class="cx">
</span><del>- template<typename T, size_t inlineCapacity>
- inline T* DequeIteratorBase<T, inlineCapacity>::before() const
- {
- checkValidity();
- ASSERT(m_index != m_deque->m_start);
- if (!m_index)
- return std::addressof(m_deque->m_buffer.buffer()[m_deque->m_buffer.capacity() - 1]);
- return std::addressof(m_deque->m_buffer.buffer()[m_index - 1]);
- }
</del><ins>+template<typename T, size_t inlineCapacity>
+inline T* DequeIteratorBase<T, inlineCapacity>::before() const
+{
+ checkValidity();
+ ASSERT(m_index != m_deque->m_start);
+ if (!m_index)
+ return std::addressof(m_deque->m_buffer.buffer()[m_deque->m_buffer.capacity() - 1]);
+ return std::addressof(m_deque->m_buffer.buffer()[m_index - 1]);
+}
</ins><span class="cx">
</span><span class="cx"> } // namespace WTF
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>