mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Expand the strings we intern
Based on analysis of a handful of websites (amazon product, github, DDG, reddit)
This commit is contained in:
@@ -181,24 +181,67 @@ 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 " ",
|
||||||
|
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 " ",
|
||||||
else => {},
|
else => {},
|
||||||
},
|
},
|
||||||
13 => switch (@as(u104, @bitCast(input[0..13].*))) {
|
13 => switch (@as(u104, @bitCast(input[0..13].*))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user