Skip to content

Commit 4465b2f

Browse files
committed
Inline char_at() and record_width.
Because `bump()` is hot.
1 parent 6fc409e commit 4465b2f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/libsyntax/str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[inline]
1112
pub fn char_at(s: &str, byte: usize) -> char {
1213
s[byte..].chars().next().unwrap()
1314
}

src/libsyntax_pos/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,7 @@ impl FileMap {
10471047
self.multibyte_chars.borrow_mut().push(mbc);
10481048
}
10491049

1050+
#[inline]
10501051
pub fn record_width(&self, pos: BytePos, ch: char) {
10511052
let width = match ch {
10521053
'\t' =>

0 commit comments

Comments
 (0)