diff options
| author | Fri3dNstuff <102751849+Fri3dNstuff@users.noreply.github.com> | 2024-08-05 01:02:15 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-04 22:02:15 +0000 |
| commit | a655c15c4004d553ea462652f69acd37e4514f79 (patch) | |
| tree | 2583cde80585d836509b2edfe11e98a22385327a /lib/compiler/aro | |
| parent | ea847535fc393f7f73801285af8960379e9376c8 (diff) | |
| download | zig-a655c15c4004d553ea462652f69acd37e4514f79.tar.gz zig-a655c15c4004d553ea462652f69acd37e4514f79.zip | |
std.sort: Remove key argument from binary-search-like functions (#20927)
closes #20110
Diffstat (limited to 'lib/compiler/aro')
| -rw-r--r-- | lib/compiler/aro/aro/Preprocessor.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/compiler/aro/aro/Preprocessor.zig b/lib/compiler/aro/aro/Preprocessor.zig index 06193bf3e4..aa0a64c3e7 100644 --- a/lib/compiler/aro/aro/Preprocessor.zig +++ b/lib/compiler/aro/aro/Preprocessor.zig @@ -265,14 +265,13 @@ fn clearBuffers(pp: *Preprocessor) void { pub fn expansionSlice(pp: *Preprocessor, tok: Tree.TokenIndex) []Source.Location { const S = struct { - fn order_token_index(context: void, lhs: Tree.TokenIndex, rhs: Tree.TokenIndex) std.math.Order { - _ = context; - return std.math.order(lhs, rhs); + fn orderTokenIndex(context: Tree.TokenIndex, item: Tree.TokenIndex) std.math.Order { + return std.math.order(item, context); } }; const indices = pp.expansion_entries.items(.idx); - const idx = std.sort.binarySearch(Tree.TokenIndex, tok, indices, {}, S.order_token_index) orelse return &.{}; + const idx = std.sort.binarySearch(Tree.TokenIndex, indices, tok, S.orderTokenIndex) orelse return &.{}; const locs = pp.expansion_entries.items(.locs)[idx]; var i: usize = 0; while (locs[i].id != .unused) : (i += 1) {} |
