1
0
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:
Eric Herman
2021-11-05 19:03:38 +01:00
committed by Robert Bindar
parent f9ad8072cd
commit 6a282df0be
2 changed files with 0 additions and 27 deletions

View File

@@ -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