x if cond else y and x when cond else y expressions

This commit is contained in:
gingerBill
2020-03-05 20:34:30 +00:00
parent 2fe0eaf2ad
commit e92fdb4a99
20 changed files with 336 additions and 44 deletions
+1 -1
View File
@@ -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;
}