Add methods push_move & pop_move.

Rewrite _pop_back to be a little bit faster for complex structure as it used
DO_MOVE instead of plain _set.
This commit is contained in:
Patrick Pelissier committed 2018-05-19 11:21:18 +02:00
1 parent 281f567d97
commit 86083e3a92
2 files changed
+38 -4

No files matched your search

+10 -1
View File
@@ -180,7 +180,16 @@ static void test_uint(void)
assert (!list_uint_equal_p(v,v2));
assert (list_uint_hash(v) != 0);
x = 1478963;
s = *list_uint_back(v);
list_uint_push_move(v, &x);
assert (*list_uint_back(v) == 1478963);
x = 0;
list_uint_pop_move(&x, v);
assert (x == 1478963);
assert (s == *list_uint_back(v));
list_uint_clear(v);
list_uint_clear(v2);
}