zig/lib
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
..
compiler std: Restore conventional compareFn behavior for binarySearch 2024-09-16 14:04:18 -07:00
compiler_rt compiler_rt: Export __truncdfhf2() for AEABI too. 2024-09-10 08:53:30 +02:00
docs Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
fuzzer/web Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
include update C language headers to LLVM 18 2024-05-08 19:37:28 -07:00
init fix init template for new fuzz testing API 2024-09-11 13:41:29 -07:00
libc Merge pull request #21195 from alexrp/glibc-fixes 2024-09-06 10:50:56 -07:00
libcxx update libcxx and libcxxabi to llvm 18.1.6 2024-05-20 16:12:36 -04:00
libcxxabi update libcxx and libcxxabi to llvm 18.1.6 2024-05-20 16:12:36 -04:00
libunwind libunwind: update to LLVM 18 2024-05-08 19:37:29 -07:00
std std: Restore conventional compareFn behavior for binarySearch 2024-09-16 14:04:18 -07:00
tsan tsan: update rtl files to LLVM 17.0.6 2024-01-10 01:00:37 -07:00
c.zig compiler,lib,test,langref: migrate @setCold to @branchHint 2024-08-27 00:44:35 +01:00
compiler_rt.zig stage2-wasm: bit_reverse 2024-06-16 11:53:33 +02:00
fuzzer.zig Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
zig.h zig.h: fixup pointer atomic load definitions 2024-07-26 10:42:10 -04:00