| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(sort_key_buf), | intent(in) | :: | keys(:) |
the keys; row n_search+1 is the target. |
||
| integer(kind=int64), | intent(in) | :: | n_search |
rows being searched. |
||
| logical, | intent(in) | :: | upper |
.true. for upper_bound. |
1-based insertion point in 1..n_search+1.
Binary search for the target row, which the caller APPENDED as row n_search + 1.
Preserve the appending. It is what removes any compare-a-row-against-a-value arm and so makes drift from the sort comparator structurally impossible — Risk-34.