Skip to content

Commit 2272558

Browse files
committed
Never inline lookup_slow.
1 parent 34ac75b commit 2272558

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

library/core/src/unicode/unicode_data.rs

+2
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ pub mod grapheme_extend {
433433
pub fn lookup(c: char) -> bool {
434434
(c as u32) >= 0x300 && lookup_slow(c)
435435
}
436+
437+
#[inline(never)]
436438
fn lookup_slow(c: char) -> bool {
437439
const {
438440
assert!(SHORT_OFFSET_RUNS.last().unwrap().0 > (char::MAX as u32));

src/tools/unicode-table-generator/src/skiplist.rs

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ impl RawEmitter {
105105
writeln!(&mut self.file, " (c as u32) >= {first_code_point:#04x} && lookup_slow(c)")
106106
.unwrap();
107107
writeln!(&mut self.file, "}}").unwrap();
108+
writeln!(&mut self.file).unwrap();
109+
writeln!(&mut self.file, "#[inline(never)]").unwrap();
108110
writeln!(&mut self.file, "fn lookup_slow(c: char) -> bool {{").unwrap();
109111
} else {
110112
writeln!(&mut self.file, "pub fn lookup(c: char) -> bool {{").unwrap();

0 commit comments

Comments
 (0)