API breakage:
rename _constains into _contain_p to be more uniform with other predicate functions, and to use infinitive form for the method.
This commit is contained in:
1 parent
bc3fa890bd
commit
b2f005239b
3 files changed
+7
-5
No files matched your search
@@ -16,5 +16,7 @@ V0.2.*: * worker_sync takes a 'worker_t' as an additional parameter
|
|||||||
Since there is no key, it is a push method, not a _set_at method.
|
Since there is no key, it is a push method, not a _set_at method.
|
||||||
* DICT_SET_DEF2 ==> DICT_SET_DEF
|
* DICT_SET_DEF2 ==> DICT_SET_DEF
|
||||||
since it only requires one argument.
|
since it only requires one argument.
|
||||||
|
* ALGO _contains ==> _contain_p
|
||||||
|
since it is a predicate '_p' and it shall be in infinitive form.
|
||||||
|
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline bool \
|
static inline bool \
|
||||||
M_C(name, _contains) (container_t l, type_t const data) \
|
M_C(name, _contain_p) (container_t l, type_t const data) \
|
||||||
{ \
|
{ \
|
||||||
it_t it; \
|
it_t it; \
|
||||||
M_C(name,_find)(it, l, data); \
|
M_C(name,_find)(it, l, data); \
|
||||||
|
|||||||
+4
-4
@@ -92,8 +92,8 @@ static void test_list(void)
|
|||||||
list_int_init(l);
|
list_int_init(l);
|
||||||
for(int i = 0; i < 100; i++)
|
for(int i = 0; i < 100; i++)
|
||||||
list_int_push_back (l, i);
|
list_int_push_back (l, i);
|
||||||
assert( algo_list_contains(l, 62) == true);
|
assert( algo_list_contain_p(l, 62) == true);
|
||||||
assert( algo_list_contains(l, -1) == false);
|
assert( algo_list_contain_p(l, -1) == false);
|
||||||
|
|
||||||
assert( algo_list_count(l, 1) == 1);
|
assert( algo_list_count(l, 1) == 1);
|
||||||
list_int_push_back (l, 17);
|
list_int_push_back (l, 17);
|
||||||
@@ -158,8 +158,8 @@ static void test_array(void)
|
|||||||
array_int_init(l);
|
array_int_init(l);
|
||||||
for(int i = 0; i < 100; i++)
|
for(int i = 0; i < 100; i++)
|
||||||
array_int_push_back (l, i);
|
array_int_push_back (l, i);
|
||||||
assert( algo_array_contains(l, 62) == true);
|
assert( algo_array_contain_p(l, 62) == true);
|
||||||
assert( algo_array_contains(l, -1) == false);
|
assert( algo_array_contain_p(l, -1) == false);
|
||||||
assert( algo_array_sort_p(l) == true);
|
assert( algo_array_sort_p(l) == true);
|
||||||
|
|
||||||
assert( algo_array_count(l, 1) == 1);
|
assert( algo_array_count(l, 1) == 1);
|
||||||
|
|||||||
Reference in new issue
Block a user