mirror of
https://github.com/ziglang/zig.git
synced 2025-02-16 09:30:17 +00:00
Change math.Order order (#16356)
This speeds up algorithms like binary search
This commit is contained in:
parent
131bfe2f74
commit
27a66191c2
@ -1482,15 +1482,15 @@ test "mulWide" {
|
||||
|
||||
/// See also `CompareOperator`.
|
||||
pub const Order = enum {
|
||||
/// Greater than (`>`)
|
||||
gt,
|
||||
|
||||
/// Less than (`<`)
|
||||
lt,
|
||||
|
||||
/// Equal (`==`)
|
||||
eq,
|
||||
|
||||
/// Greater than (`>`)
|
||||
gt,
|
||||
|
||||
pub fn invert(self: Order) Order {
|
||||
return switch (self) {
|
||||
.lt => .gt,
|
||||
|
@ -10,7 +10,7 @@ pub export fn entry1() void {
|
||||
// target=native
|
||||
//
|
||||
// :5:5: error: switch must handle all possibilities
|
||||
// :?:?: note: unhandled enumeration value: 'gt'
|
||||
// :?:?: note: unhandled enumeration value: 'lt'
|
||||
// :?:?: note: unhandled enumeration value: 'eq'
|
||||
// :?:?: note: unhandled enumeration value: 'gt'
|
||||
// :?:?: note: enum 'math.Order' declared here
|
||||
|
Loading…
Reference in New Issue
Block a user