authorgravatar for Validark@pm.meNiles Salter <Validark@pm.me> 2023-07-08 23:22:52-06:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-07-09 01:22:52-04:00
log27a66191c271d2a8b1b6ebcbef0bbdeb8d389a38
treec5b89505b06183f67eb240f59affce8d1f0f531d
parent131bfe2f7488cab02c492ca3afc6d2a18bc83aac
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Change math.Order order (#16356)

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" {
14821482
14831483/// See also `CompareOperator`.
14841484pub const Order = enum {
1485 /// Greater than (`>`)
1486 gt,
1487
14851488 /// Less than (`<`)
14861489 lt,
14871490
14881491 /// Equal (`==`)
14891492 eq,
14901493
1491 /// Greater than (`>`)
1492 gt,
1493
14941494 pub fn invert(self: Order) Order {
14951495 return switch (self) {
14961496 .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 {
1010// target=native
1111//
1212// :5:5: error: switch must handle all possibilities
13// :?:?: note: unhandled enumeration value: 'gt'
1314// :?:?: note: unhandled enumeration value: 'lt'
1415// :?:?: note: unhandled enumeration value: 'eq'
15// :?:?: note: unhandled enumeration value: 'gt'
1616// :?:?: note: enum 'math.Order' declared here