From e92fdb4a99bf9d27009dd35fdd074ff14facfc03 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 5 Mar 2020 20:34:30 +0000 Subject: `x if cond else y` and `x when cond else y` expressions --- core/strings/strings.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/strings') diff --git a/core/strings/strings.odin b/core/strings/strings.odin index a477b9e13..fd3808684 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -325,7 +325,7 @@ last_index :: proc(s, substr: string) -> int { case n == 1: return last_index_byte(s, substr[0]); case n == len(s): - return substr == s ? 0 : -1; + return 0 if substr == s else -1; case n > len(s): return -1; } -- cgit v1.2.3