diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2022-05-31 11:52:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-31 11:52:24 +0100 |
| commit | a1f15c2c69b557be5a95882d18137d1f74d980ee (patch) | |
| tree | 3f484753712a6d9d9cf1074f56bc91af6d6432c1 /src/string.cpp | |
| parent | a6c779b50ecf5c8c0cb86c9d49768ab34508b1d2 (diff) | |
| parent | 516f6647b46c69a67139154c02c74b436cd4b999 (diff) | |
Merge pull request #1807 from odin-lang/simd-dev
Generic #simd type and intrinsics
Diffstat (limited to 'src/string.cpp')
| -rw-r--r-- | src/string.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/string.cpp b/src/string.cpp index 616761265..44eccd2d2 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -157,6 +157,15 @@ int string_compare(String const &x, String const &y) { return 0; } +isize string_index_byte(String const &s, u8 x) { + for (isize i = 0; i < s.len; i++) { + if (s.text[i] == x) { + return i; + } + } + return -1; +} + GB_COMPARE_PROC(string_cmp_proc) { String x = *(String *)a; String y = *(String *)b; |