search<E> static method
Implementation
static int search<E>(List<Extent<E>> extents, E value) {
if (extents.isEmpty) return -1;
Comparator comp;
if (extents.first.isAscending) {
comp = (e, value) {
Extent extent = e;
if (extent.has(value)) return 0;
return extent.comparator(extent.lower, value);
};
} else {
comp = (e, value) {
Extent extent = e;
if (extent.has(value)) return 0;
return -extent.comparator(extent.lower, value);
};
}
return binarySearch<dynamic>(extents, value, compare: comp);
}