MultiItems.FindSortedPlace


static function FindSortedPlace

Prototype:

static function FindSortedPlace(arr, sort_column, element, direction)

Parameters

arr
array of MultiItems.
sort_column
the number of the column in the array to use as the sort column
element
an array or an element that need to be added the the array (arr parameter)
direction
1 for ascending, anything else for descending

Description:

This function finds the position to add an element, in order to keep the array sorted. It uses a simple binary search in order to get better timings.

Return value:

Returns the position in which the element can be inserted into the array.