Skip to content

Commit e5d4de3

Browse files
committed
generated code
1 parent 89ace47 commit e5d4de3

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

library/core/src/unicode/unicode_data.rs

+17-10
Original file line numberDiff line numberDiff line change
@@ -544,18 +544,25 @@ pub mod uppercase {
544544

545545
#[rustfmt::skip]
546546
pub mod white_space {
547-
static SHORT_OFFSET_RUNS: [u32; 4] = [
548-
5760, 18882560, 23080960, 40972289,
549-
];
550-
static OFFSETS: [u8; 21] = [
551-
9, 5, 18, 1, 100, 1, 26, 1, 0, 1, 0, 11, 29, 2, 5, 1, 47, 1, 0, 1, 0,
547+
static WHITESPACE_MAP: [u8; 256] = [
548+
2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
549+
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
550+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
551+
0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
552+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
553+
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
554+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
555+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
556+
0, 0, 0, 0, 0, 0, 0, 0, 0,
552557
];
553558
pub fn lookup(c: char) -> bool {
554-
super::skip_search(
555-
c as u32,
556-
&SHORT_OFFSET_RUNS,
557-
&OFFSETS,
558-
)
559+
match c as u32 >> 8 {
560+
0 => WHITESPACE_MAP[c as usize & 0xff] & 1 != 0,
561+
22 => c as u32 == 0x1680,
562+
32 => WHITESPACE_MAP[c as usize & 0xff] & 2 != 0,
563+
48 => c as u32 == 0x3000,
564+
_ => false,
565+
}
559566
}
560567
}
561568

0 commit comments

Comments
 (0)