mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-07-03 19:19:28 +08:00
24 lines
395 B
Go
24 lines
395 B
Go
// License: GPLv3 Copyright: 2024, Kovid Goyal, <kovid at kovidgoyal.net>
|
|
|
|
package simdstring
|
|
|
|
func index_byte2_scalar(data []byte, a, b byte) int {
|
|
for i, ch := range data {
|
|
switch ch {
|
|
case a, b:
|
|
return i
|
|
}
|
|
}
|
|
return -1
|
|
}
|
|
|
|
func index_byte2_string_scalar(data string, a, b byte) int {
|
|
for i := 0; i < len(data); i++ {
|
|
switch data[i] {
|
|
case a, b:
|
|
return i
|
|
}
|
|
}
|
|
return -1
|
|
}
|