mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Merge pull request #1669 from lightpanda-io/more_interned_strings
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
Expand the strings we intern
This commit is contained in:
@@ -213,23 +213,66 @@ pub const String = packed struct {
|
|||||||
'\r' => return "\r",
|
'\r' => return "\r",
|
||||||
'\t' => return "\t",
|
'\t' => return "\t",
|
||||||
' ' => return " ",
|
' ' => return " ",
|
||||||
|
'0' => return "0",
|
||||||
|
'1' => return "1",
|
||||||
|
'2' => return "2",
|
||||||
|
'3' => return "3",
|
||||||
|
'4' => return "4",
|
||||||
|
'5' => return "5",
|
||||||
|
'6' => return "6",
|
||||||
|
'7' => return "7",
|
||||||
|
'8' => return "8",
|
||||||
|
'9' => return "9",
|
||||||
|
'.' => return ".",
|
||||||
|
',' => return ",",
|
||||||
|
'-' => return "-",
|
||||||
|
'(' => return "(",
|
||||||
|
')' => return ")",
|
||||||
|
'?' => return "?",
|
||||||
|
';' => return ";",
|
||||||
|
'=' => return "=",
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
2 => switch (@as(u16, @bitCast(input[0..2].*))) {
|
2 => switch (@as(u16, @bitCast(input[0..2].*))) {
|
||||||
asUint("id") => return "id",
|
asUint("id") => return "id",
|
||||||
asUint(" ") => return " ",
|
asUint(" ") => return " ",
|
||||||
asUint("\r\n") => return "\r\n",
|
asUint("\r\n") => return "\r\n",
|
||||||
|
asUint(", ") => return ", ",
|
||||||
|
asUint("·") => return "·",
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
3 => switch (@as(u24, @bitCast(input[0..3].*))) {
|
3 => switch (@as(u24, @bitCast(input[0..3].*))) {
|
||||||
asUint(" ") => return " ",
|
asUint(" ") => return " ",
|
||||||
|
asUint("•") => return "•",
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
4 => switch (@as(u32, @bitCast(input[0..4].*))) {
|
4 => switch (@as(u32, @bitCast(input[0..4].*))) {
|
||||||
asUint(" ") => return " ",
|
asUint(" ") => return " ",
|
||||||
|
asUint(" to ") => return " to ",
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
5 => switch (@as(u40, @bitCast(input[0..5].*))) {
|
5 => switch (@as(u40, @bitCast(input[0..5].*))) {
|
||||||
|
asUint(" ") => return " ",
|
||||||
|
asUint(" › ") => return " › ",
|
||||||
|
else => {},
|
||||||
|
},
|
||||||
|
6 => switch (@as(u48, @bitCast(input[0..6].*))) {
|
||||||
|
asUint(" ") => return " ",
|
||||||
|
else => {},
|
||||||
|
},
|
||||||
|
7 => switch (@as(u56, @bitCast(input[0..7].*))) {
|
||||||
|
asUint(" ") => return " ",
|
||||||
|
else => {},
|
||||||
|
},
|
||||||
|
8 => switch (@as(u64, @bitCast(input[0..8].*))) {
|
||||||
|
asUint(" ") => return " ",
|
||||||
|
else => {},
|
||||||
|
},
|
||||||
|
9 => switch (@as(u72, @bitCast(input[0..9].*))) {
|
||||||
|
asUint(" ") => return " ",
|
||||||
|
else => {},
|
||||||
|
},
|
||||||
|
10 => switch (@as(u80, @bitCast(input[0..10].*))) {
|
||||||
asUint(" ") => return " ",
|
asUint(" ") => return " ",
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user