mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
adding tests and changing trimLeft to pass long unique test
This commit is contained in:
parent
c1a48c0a9a
commit
151c92bb48
2 changed files with 89 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue