aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-05-30 14:53:12 +0100
committergingerBill <bill@gingerbill.org>2022-05-30 14:53:12 +0100
commitf3aefbc4434b92fc3fda74c942c953b08dd18a62 (patch)
treed13281680a7cd14ce92630cb9d3a49c984b2a888 /src/string.cpp
parentcef022539ebd41a4a80707f1a702e09e6748ade0 (diff)
`@(require_target_feature=<string>)` `@(enable_target_feature=<string>)`
require_target_feature - required by the target micro-architecture enable_target_feature - will be enabled for the specified procedure only
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp9
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;