zig/lib/std/debug
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
..
Dwarf Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
Coverage.zig std: Restore conventional compareFn behavior for binarySearch 2024-09-16 14:04:18 -07:00
Dwarf.zig std: Restore conventional compareFn behavior for binarySearch 2024-09-16 14:04:18 -07:00
FixedBufferReader.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
Info.zig std.debug.Coverage.resolveAddressesDwarf: assert sorted 2024-08-13 19:29:55 -07:00
MemoryAccessor.zig std.debug: reorg and clarify API goals 2024-08-01 23:11:59 -07:00
Pdb.zig std.pdb: obey naming conventions 2024-08-29 23:43:52 +01:00
SelfInfo.zig std: Restore conventional compareFn behavior for binarySearch 2024-09-16 14:04:18 -07:00