| author | |
| committer | |
| log | 27a66191c271d2a8b1b6ebcbef0bbdeb8d389a38 |
| tree | c5b89505b06183f67eb240f59affce8d1f0f531d |
| parent | 131bfe2f7488cab02c492ca3afc6d2a18bc83aac |
| signature |
This speeds up algorithms like binary search
2 files changed, 4 insertions(+), 4 deletions(-)
lib/std/math.zig+3-3| ... | @@ -1482,15 +1482,15 @@ test "mulWide" { | ... | @@ -1482,15 +1482,15 @@ test "mulWide" { |
| 1482 | 1482 | ||
| 1483 | /// See also `CompareOperator`. | 1483 | /// See also `CompareOperator`. |
| 1484 | pub const Order = enum { | 1484 | pub const Order = enum { |
| 1485 | /// Greater than (`>`) | ||
| 1486 | gt, | ||
| 1487 | |||
| 1485 | /// Less than (`<`) | 1488 | /// Less than (`<`) |
| 1486 | lt, | 1489 | lt, |
| 1487 | 1490 | ||
| 1488 | /// Equal (`==`) | 1491 | /// Equal (`==`) |
| 1489 | eq, | 1492 | eq, |
| 1490 | 1493 | ||
| 1491 | /// Greater than (`>`) | ||
| 1492 | gt, | ||
| 1493 | |||
| 1494 | pub fn invert(self: Order) Order { | 1494 | pub fn invert(self: Order) Order { |
| 1495 | return switch (self) { | 1495 | return switch (self) { |
| 1496 | .lt => .gt, | 1496 | .lt => .gt, |
test/cases/compile_errors/unhandled_enum_value_in_switch_with_enum_declared_in_other_file.zig+1-1| ... | @@ -10,7 +10,7 @@ pub export fn entry1() void { | ... | @@ -10,7 +10,7 @@ pub export fn entry1() void { |
| 10 | // target=native | 10 | // target=native |
| 11 | // | 11 | // |
| 12 | // :5:5: error: switch must handle all possibilities | 12 | // :5:5: error: switch must handle all possibilities |
| 13 | // :?:?: note: unhandled enumeration value: 'gt' | ||
| 13 | // :?:?: note: unhandled enumeration value: 'lt' | 14 | // :?:?: note: unhandled enumeration value: 'lt' |
| 14 | // :?:?: note: unhandled enumeration value: 'eq' | 15 | // :?:?: note: unhandled enumeration value: 'eq' |
| 15 | // :?:?: note: unhandled enumeration value: 'gt' | ||
| 16 | // :?:?: note: enum 'math.Order' declared here | 16 | // :?:?: note: enum 'math.Order' declared here |