zig/lib/compiler
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
..
aro std: Restore conventional compareFn behavior for binarySearch 2024-09-16 14:04:18 -07:00
aro_translate_c Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
reduce reduce: fix compile errors 2024-03-24 17:29:39 +01:00
resinator Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
aro_translate_c.zig Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
build_runner.zig Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
fmt.zig std.posix: read on timerfd can return error.Canceled 2024-08-08 01:12:26 -07:00
libc.zig zig libc: allow non-native targets 2024-03-13 02:17:28 -04:00
objcopy.zig Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
reduce.zig Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
std-docs.zig Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
test_runner.zig Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00