Skip to content

Commit b445e92

Browse files
committed
refactor: Include size of case conversion tables
Include the sizes of the `to_lowercase` and `to_uppercase` tables in the total size calculations.
1 parent aa35e6a commit b445e92

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

core/src/unicode/unicode_data.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// N : 457 bytes, 1911 codepoints in 144 ranges (U+000030 - U+01FBFA) using skiplist
99
// Uppercase : 799 bytes, 1978 codepoints in 656 ranges (U+000041 - U+01F18A) using bitset
1010
// White_Space : 256 bytes, 25 codepoints in 10 ranges (U+000009 - U+003001) using cascading
11-
// Total : 6530 bytes
11+
// to_lower : 11484 bytes
12+
// to_upper : 13432 bytes
13+
// Total : 31446 bytes
1214

1315
#[inline(always)]
1416
const fn bitset_search<
@@ -782,7 +784,7 @@ pub mod conversions {
782784
}
783785
}
784786

785-
static LOWERCASE_TABLE: &[(char, u32)] = &[
787+
static LOWERCASE_TABLE: &[(char, u32); 1434] = &[
786788
('\u{c0}', 224), ('\u{c1}', 225), ('\u{c2}', 226), ('\u{c3}', 227), ('\u{c4}', 228),
787789
('\u{c5}', 229), ('\u{c6}', 230), ('\u{c7}', 231), ('\u{c8}', 232), ('\u{c9}', 233),
788790
('\u{ca}', 234), ('\u{cb}', 235), ('\u{cc}', 236), ('\u{cd}', 237), ('\u{ce}', 238),
@@ -1132,11 +1134,11 @@ pub mod conversions {
11321134
('\u{1e921}', 125251),
11331135
];
11341136

1135-
static LOWERCASE_TABLE_MULTI: &[[char; 3]] = &[
1137+
static LOWERCASE_TABLE_MULTI: &[[char; 3]; 1] = &[
11361138
['i', '\u{307}', '\u{0}'],
11371139
];
11381140

1139-
static UPPERCASE_TABLE: &[(char, u32)] = &[
1141+
static UPPERCASE_TABLE: &[(char, u32); 1526] = &[
11401142
('\u{b5}', 924), ('\u{df}', 4194304), ('\u{e0}', 192), ('\u{e1}', 193), ('\u{e2}', 194),
11411143
('\u{e3}', 195), ('\u{e4}', 196), ('\u{e5}', 197), ('\u{e6}', 198), ('\u{e7}', 199),
11421144
('\u{e8}', 200), ('\u{e9}', 201), ('\u{ea}', 202), ('\u{eb}', 203), ('\u{ec}', 204),
@@ -1509,7 +1511,7 @@ pub mod conversions {
15091511
('\u{1e941}', 125215), ('\u{1e942}', 125216), ('\u{1e943}', 125217),
15101512
];
15111513

1512-
static UPPERCASE_TABLE_MULTI: &[[char; 3]] = &[
1514+
static UPPERCASE_TABLE_MULTI: &[[char; 3]; 102] = &[
15131515
['S', 'S', '\u{0}'], ['\u{2bc}', 'N', '\u{0}'], ['J', '\u{30c}', '\u{0}'],
15141516
['\u{399}', '\u{308}', '\u{301}'], ['\u{3a5}', '\u{308}', '\u{301}'],
15151517
['\u{535}', '\u{552}', '\u{0}'], ['H', '\u{331}', '\u{0}'], ['T', '\u{308}', '\u{0}'],

0 commit comments

Comments
 (0)