mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL1034 update for latest 5.1 sources
BUILD/SETUP.sh: for now no optimizations in debug build - get rid of "value optimized out"
This commit is contained in:
@ -278,3 +278,28 @@ void freeze_size(DYNAMIC_ARRAY *array)
|
||||
array->max_element=elements;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Get the index of a dynamic element
|
||||
|
||||
SYNOPSIS
|
||||
get_index_dynamic()
|
||||
array Array
|
||||
element Whose element index
|
||||
|
||||
*/
|
||||
|
||||
int get_index_dynamic(DYNAMIC_ARRAY *array, gptr element)
|
||||
{
|
||||
uint ret;
|
||||
if (array->buffer > element)
|
||||
return -1;
|
||||
|
||||
ret= (element - array->buffer) / array->size_of_element;
|
||||
if (ret > array->elements)
|
||||
return -1;
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user