mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
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.
This commit is contained in:
committed by
Robert Bindar
parent
f9ad8072cd
commit
6a282df0be
@@ -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
|
||||
|
Reference in New Issue
Block a user