Remove shrink_to_fit which is useless as reserve performs its role now too.

This commit is contained in:
Patrick Pelissier committed 2017-04-14 11:32:17 +02:00
1 parent a1dec4dfe9
commit 418d868b1d
3 files changed
+2 -11

No files matched your search

-9
View File
@@ -474,15 +474,6 @@
) /* IF INIT_MOVE method */ \
} \
\
static inline void \
M_C3(array_, name, _shrink_to_fit)(M_C3(array_, name,_t) v) \
{ \
assert (v != NULL && v->size <= v->alloc); \
v->ptr = M_GET_REALLOC oplist (type, v->ptr, v->size); \
assert(v->ptr != NULL || v->size == 0); \
v->alloc = v->size; \
} \
\
static inline type * \
M_C3(array_, name, _get)(M_C3(array_, name,_t) v, size_t i) \
{ \
+1 -1
View File
@@ -625,6 +625,6 @@ bitset_hash(const bitset_t dest)
,EQUAL(bitset_equal_p) \
)
// TODO: set_at2, insert_v, remove_v, shrink_to_fit
// TODO: set_at2, insert_v, remove_v, reserve
#endif
+1 -1
View File
@@ -104,7 +104,7 @@ static void test_uint(void)
assert(*array_uint_cget(v, 2) == 4);
assert(*array_uint_cget(v, 3) == 3);
array_uint_shrink_to_fit(v);
array_uint_reserve(v, 0);
assert(array_uint_capacity(v) == array_uint_size(v));
const unsigned int *src = array_uint_cget(v, 4);