Fix JSX unicode handling, slightly improve perf

This commit is contained in:
Jarred Sumner
2021-10-25 05:42:01 -07:00
parent 2ed6605cc3
commit 4e889c7b47
4 changed files with 136 additions and 150 deletions

View File

@@ -110,6 +110,10 @@ pub const ZigString = extern struct {
return this.ptr[0..std.math.min(this.len, 4096)];
}
pub inline fn full(this: *const ZigString) []const u8 {
return this.ptr[0..this.len];
}
pub fn trimmedSlice(this: *const ZigString) []const u8 {
return std.mem.trim(u8, this.ptr[0..std.math.min(this.len, 4096)], " \r\n");
}