Commit 6a282df0 authored by Eric Herman's avatar Eric Herman Committed by Robert Bindar

Remove DYNAMIC_ARRAY get_index_dynamic()

The DYNAMIC_ARRAY copies values in and copies values out. Without a
comparitor function, get_index_dynamic() does not make sense.

This function is not used. If we have a need for a function like it
in the future, I propose we write a new one with unit tests showing
how it is used and demostrating that it behaves as expected.
parent f9ad8072
......@@ -850,7 +850,6 @@ extern void delete_dynamic(DYNAMIC_ARRAY *array);
extern void delete_dynamic_element(DYNAMIC_ARRAY *array, size_t array_index);
extern void delete_dynamic_with_callback(DYNAMIC_ARRAY *array, FREE_FUNC f);
extern void freeze_size(DYNAMIC_ARRAY *array);
extern int get_index_dynamic(DYNAMIC_ARRAY *array, void *element);
#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element)
#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index))
#define push_dynamic(A,B) insert_dynamic((A),(B))
......
......@@ -375,29 +375,3 @@ void freeze_size(DYNAMIC_ARRAY *array)
array->max_element= elements;
}
}
#ifdef NOT_USED
/*
Get the index of a dynamic element
SYNOPSIS
get_index_dynamic()
array Array
element Whose element index
*/
int get_index_dynamic(DYNAMIC_ARRAY *array, void* element)
{
size_t ret;
if (array->buffer > (uchar*) element)
return -1;
ret= ((uchar*) element - array->buffer) / array->size_of_element;
if (ret > array->elements)
return -1;
return ret;
}
#endif
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