adding tests and changing trimLeft to pass long unique test

This commit is contained in:
Michael Downey 2021-11-09 18:16:32 -05:00
parent c1a48c0a9a
commit 151c92bb48
2 changed files with 89 additions and 5 deletions

View file

@ -1569,11 +1569,9 @@ pub fn strTrimLeft(string: RocStr) callconv(.C) RocStr {
if (leading_bytes > 0) {
var i: usize = 0;
while (i < new_len) : (i += 1) {
if (i >= leading_bytes - 1) {
const dest = bytes_ptr + i;
const source = dest + leading_bytes;
@memcpy(dest, source, 1);
}
const dest = bytes_ptr + i;
const source = dest + leading_bytes;
@memcpy(dest, source, 1);
}
}