aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv.zig
diff options
context:
space:
mode:
authorJohn Schmidt <john.schmidt.h@gmail.com>2024-01-27 22:43:35 +0100
committerJohn Schmidt <john.schmidt.h@gmail.com>2024-02-07 21:00:24 +0100
commite487b576fadc2fd48100667ff233e4a0bb4f0aa5 (patch)
tree27084584f2dd67cb33f5903d2c950f5149f6ce04 /src/codegen/spirv.zig
parent664c18544c2622352a4e38254496a349006d331b (diff)
downloadzig-e487b576fadc2fd48100667ff233e4a0bb4f0aa5.tar.gz
zig-e487b576fadc2fd48100667ff233e4a0bb4f0aa5.zip
Changes to lowerBound/upperBound/equalRange
The old definitions had some problems: - In `lowerBound`, the `lhs` (left hand side) argument was passed on the right hand side. - In `upperBound`, the `greaterThan` function needed to return `greaterThanOrEqual` for the function work, so either the name or the implementation is incorrect. To fix both problems, define the functions in terms of a `lessThan` function that returns `lhs < rhs`. The is more consistent with the rest of `sort.zig` and it's also how C++ implements lower/upperBound (1)(2). (1) https://en.cppreference.com/w/cpp/algorithm/lower_bound (2) https://en.cppreference.com/w/cpp/algorithm/upper_bound - Rewrite doc comments. - Add a couple of more test cases. - Add docstring for std.sort.binarySearch
Diffstat (limited to 'src/codegen/spirv.zig')
0 files changed, 0 insertions, 0 deletions