- {
- size_t mid = low + (high - low) / 2; /* low <= mid < high */
-
- if (! threshold_fn (set->elements[mid], threshold))
- low = mid + 1;
- else
- {
- /* We have an element >= THRESHOLD at index MID. But we need the
- minimal such index. */
- high = mid;
- /* At each loop iteration, low <= high and
- compar (list->elements[high], value) >= 0,
- and we know that the first occurrence of the element is at
- low <= position <= high. */
- while (low < high)
- {
- size_t mid2 = low + (high - low) / 2; /* low <= mid2 < high */
-
- if (! threshold_fn (set->elements[mid2], threshold))
- low = mid2 + 1;
- else
- high = mid2;
- }
- *eltp = set->elements[low];
- return true;
- }
- }
+ {
+ size_t mid = low + (high - low) / 2; /* low <= mid < high */
+
+ if (! threshold_fn (set->elements[mid], threshold))
+ low = mid + 1;
+ else
+ {
+ /* We have an element >= THRESHOLD at index MID. But we need the
+ minimal such index. */
+ high = mid;
+ /* At each loop iteration, low <= high and
+ compar (list->elements[high], value) >= 0,
+ and we know that the first occurrence of the element is at
+ low <= position <= high. */
+ while (low < high)
+ {
+ size_t mid2 = low + (high - low) / 2; /* low <= mid2 < high */
+
+ if (! threshold_fn (set->elements[mid2], threshold))
+ low = mid2 + 1;
+ else
+ high = mid2;
+ }
+ *eltp = set->elements[low];
+ return true;
+ }
+ }