authorgravatar for magejohnyjtp@gmail.comYuri Pieters <magejohnyjtp@gmail.com> 2020-04-09 09:13:47+01:00
committergravatar for magejohnyjtp@gmail.comYuri Pieters <magejohnyjtp@gmail.com> 2020-04-09 09:13:47+01:00
logf5f77089b76be2832640884f14c552c49c9fda1f
tree325bd9b3aed99ae59a36eb2f1cee859751aa000d
parentb7e72cc4211d7b06e2b7095f48c579ce1daaf253

sort.binarySearch: Remove unneeded edge case check


1 files changed, 0 insertions(+), 3 deletions(-)

lib/std/sort.zig-3
...@@ -6,9 +6,6 @@ const math = std.math;...@@ -6,9 +6,6 @@ const math = std.math;
6const builtin = @import("builtin");6const builtin = @import("builtin");
77
8pub fn binarySearch(comptime T: type, key: T, items: []const T, comptime compareFn: fn (lhs: T, rhs: T) math.Order) ?usize {8pub fn binarySearch(comptime T: type, key: T, items: []const T, comptime compareFn: fn (lhs: T, rhs: T) math.Order) ?usize {
9 if (items.len < 1)
10 return null;
11
12 var left: usize = 0;9 var left: usize = 0;
13 var right: usize = items.len;10 var right: usize = items.len;
1411