Inline char_at()
and record_width
.
Because `bump()` is hot.
This commit is contained in:
parent
6fc409ed09
commit
4465b2fbf3
2 changed files with 2 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[inline]
|
||||
pub fn char_at(s: &str, byte: usize) -> char {
|
||||
s[byte..].chars().next().unwrap()
|
||||
}
|
||||
|
|
|
@ -1047,6 +1047,7 @@ impl FileMap {
|
|||
self.multibyte_chars.borrow_mut().push(mbc);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn record_width(&self, pos: BytePos, ch: char) {
|
||||
let width = match ch {
|
||||
'\t' =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue