fix bugs from recent changes and additions

This commit is contained in:
Brendan Hansknecht 2023-03-15 18:25:15 -07:00
parent c1b8f468d7
commit ce29c7e92f
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
2 changed files with 3 additions and 1 deletions

View file

@ -511,6 +511,7 @@ pub fn listReleaseExcessCapacity(
@memcpy(dest_ptr, source_ptr, old_length * element_width);
}
list.decref(alignment);
return output;
}
}

View file

@ -1989,6 +1989,7 @@ pub fn isValidUnicode(buf: []const u8) bool {
while (buf[i] >= 0b1000_0000) {
// This forces prefetching, otherwise the loop can run at about half speed.
if (i + 4 >= buf.len) break;
var small_buf: [4]u8 = undefined;
@memcpy(&small_buf, @ptrCast([*]const u8, buf) + i, 4);
// TODO: Should we always inline these function calls below?
@ -1997,7 +1998,6 @@ pub fn isValidUnicode(buf: []const u8) bool {
return false;
}
i += cp_len;
if (i + 4 >= buf.len) break;
} else |_| {
return false;
}
@ -2927,6 +2927,7 @@ pub fn strReleaseExcessCapacity(
const dest_ptr = output.asU8ptrMut();
@memcpy(dest_ptr, source_ptr, old_length);
string.decref();
return output;
}