Commit 475c4f7b authored by Davi Arnaut's avatar Davi Arnaut

Increment the I_P_List counter whenever a element is inserted into

the list. Previously, the counter would only be incremented if the
insertion method push_front() was used, in which case the counter
wouldn't be incremented if a element was inserted using the push_back()
and/or insert_after() methods.

Currently this does not affect the code base because there isn't any
code that uses a counted list with the push_back() or insert_after()
methods.
parent dd17a7e0
...@@ -95,6 +95,7 @@ class I_P_List : public C, public I ...@@ -95,6 +95,7 @@ class I_P_List : public C, public I
*last= a; *last= a;
*B::prev_ptr(a)= last; *B::prev_ptr(a)= last;
I::set_last(B::next_ptr(a)); I::set_last(B::next_ptr(a));
C::inc();
} }
inline void insert_after(T *pos, T *a) inline void insert_after(T *pos, T *a)
{ {
...@@ -112,6 +113,7 @@ class I_P_List : public C, public I ...@@ -112,6 +113,7 @@ class I_P_List : public C, public I
} }
else else
I::set_last(B::next_ptr(a)); I::set_last(B::next_ptr(a));
C::inc();
} }
} }
inline void remove(T *a) inline void remove(T *a)
......
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