mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 23:54:07 +00:00
strings.compare() can be an alias of runtime.string_cmp()
This commit is contained in:
@@ -241,15 +241,7 @@ Inputs:
|
||||
Returns:
|
||||
- result: `-1` if `lhs` comes first, `1` if `rhs` comes first, or `0` if they are equal
|
||||
*/
|
||||
compare :: proc "contextless" (lhs, rhs: string) -> (res: int) {
|
||||
res = runtime.string_cmp(lhs, rhs)
|
||||
if res == 0 && len(lhs) != len(rhs) {
|
||||
return len(lhs) <= len(rhs) ? -1 : +1
|
||||
} else if len(lhs) == 0 && len(rhs) == 0 {
|
||||
return 0
|
||||
}
|
||||
return res
|
||||
}
|
||||
compare :: runtime.string_cmp
|
||||
|
||||
/*
|
||||
Checks if rune `r` in the string `s`
|
||||
|
||||
Reference in New Issue
Block a user