Commit 6dfd7cdc authored by Robert Schmidt's avatar Robert Schmidt

rename find_if_arr -> find_if to avoid name clashes

In a later commit, we will use find_if in L2. In the case of building
with E2 agent, we link e2_agent which comes with its own implementation
of find_if_arr(), which results in a name clash. Rename the OAI
implementation, as nothing uses this, anyway.
parent 7cfd5a1f
...@@ -40,7 +40,7 @@ elm_arr_t find_if_arr_it(seq_arr_t* arr, void* start_it, void* end_it, void* val ...@@ -40,7 +40,7 @@ elm_arr_t find_if_arr_it(seq_arr_t* arr, void* start_it, void* end_it, void* val
return (elm_arr_t){.found = false, .it = NULL}; return (elm_arr_t){.found = false, .it = NULL};
} }
elm_arr_t find_if_arr(seq_arr_t* arr, void* value, bool (*f)(const void*, const void*)) elm_arr_t find_if(seq_arr_t* arr, void* value, bool (*f)(const void*, const void*))
{ {
assert(arr != NULL); assert(arr != NULL);
void* start_it = seq_arr_front(arr); void* start_it = seq_arr_front(arr);
......
...@@ -42,7 +42,7 @@ typedef struct { ...@@ -42,7 +42,7 @@ typedef struct {
* @param f Function representing the predicate * @param f Function representing the predicate
* @return Whether the predicate was fullfilled and the iterator to the element if true * @return Whether the predicate was fullfilled and the iterator to the element if true
*/ */
elm_arr_t find_if_arr(seq_arr_t* arr, void* value, bool (*f)(const void* value, const void* it)); elm_arr_t find_if(seq_arr_t* arr, void* value, bool (*f)(const void* value, const void* it));
/** /**
* @brief Find elements in an array in the semi-open range [start_it, end_it) * @brief Find elements in an array in the semi-open range [start_it, end_it)
......
...@@ -52,7 +52,7 @@ int main() ...@@ -52,7 +52,7 @@ int main()
// Find element in the array // Find element in the array
int value = 50; int value = 50;
elm_arr_t elm = find_if_arr(&arr, &value, eq_int); elm_arr_t elm = find_if(&arr, &value, eq_int);
assert(elm.found == true); assert(elm.found == true);
// Check // Check
assert(*(int*)elm.it == 50); assert(*(int*)elm.it == 50);
......
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