mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-18 03:42:23 -07:00
x if cond else y and x when cond else y expressions
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user