diff options
| author | Shane Shrybman <shrybman@teksavvy.com> | 2026-02-12 11:52:55 -0500 |
|---|---|---|
| committer | Shane Shrybman <shrybman@teksavvy.com> | 2026-02-12 11:52:55 -0500 |
| commit | d1927e4eba67b309696899536de6279894fbcad6 (patch) | |
| tree | a4fb4a2b10c97f90329fbc716fb8c664aa619bac /core/strings | |
| parent | 8a2a0c5a93c73310ec6d41cb38ca524d37fc07e7 (diff) | |
strings.compare() can be an alias of runtime.string_cmp()
Diffstat (limited to 'core/strings')
| -rw-r--r-- | core/strings/strings.odin | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/core/strings/strings.odin b/core/strings/strings.odin index c19bf8c37..d40b81b3d 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -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` |