mirror of
https://github.com/janet-lang/janet
synced 2025-05-02 15:34:15 +00:00
Update src/core/string.c
Co-authored-by: John W Higgins <wishdev@gmail.com>
This commit is contained in:
parent
6e82123fdb
commit
421f7a2906
@ -582,9 +582,9 @@ static size_t trim_help_leftedge(JanetByteView str, JanetByteView set) {
|
||||
}
|
||||
|
||||
static size_t trim_help_rightedge(JanetByteView str, JanetByteView set) {
|
||||
for (size_t i = str.len - 1; i > 0; i--)
|
||||
if (!trim_help_checkset(set, str.bytes[i]))
|
||||
return i + 1;
|
||||
for (size_t i = 0; i < str.len; i++)
|
||||
if (!trim_help_checkset(set, str.bytes[str.len - i - 1]))
|
||||
return str.len - i;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user