Jay Petacat 812557bfde std: Restore conventional compareFn behavior for binarySearch
PR #20927 made some improvements to the `binarySearch` API, but one
change I found surprising was the relationship between the left-hand and
right-hand parameters of `compareFn` was inverted. This is different
from how comparison functions typically behave, both in other parts of
Zig (e.g. `std.math.order`) and in other languages (e.g. C's `bsearch`).
Unless a strong reason can be identified and documented for doing
otherwise, I think it'll be better to stick with convention.

While writing this patch and changing things back to the way they were,
the predicates of `lowerBound` and `upperBound` seemed to be the only
areas that benefited from the inversion. I don't think that benefit is
worth the cost, personally. Calling `Order.invert()` in the predicates
accomplishes the same goal.
2024-09-16 14:04:18 -07:00
..
2024-02-23 02:37:11 -07:00
2024-07-23 11:43:12 -07:00
2024-08-15 22:05:53 -07:00
2024-07-09 14:25:42 -07:00
2024-03-10 18:13:30 -07:00
2024-08-22 08:44:08 +02:00
2024-09-03 17:44:01 -07:00
2024-08-29 20:39:11 +01:00
2024-03-21 14:11:46 -07:00
2024-02-05 11:55:14 +03:30
2024-07-19 00:30:32 -07:00
2024-08-07 00:48:32 -07:00
2024-07-31 16:57:42 -07:00
2024-08-29 20:39:11 +01:00
2024-07-19 00:30:32 -07:00
2024-07-19 00:30:32 -07:00
2024-08-29 23:43:52 +01:00
2024-07-09 14:25:42 -07:00
2024-08-23 22:59:30 -07:00
2024-06-17 16:12:19 -04:00