Skip to content

Commit 4398d77

Browse files
authored
Merge pull request #37 from zummenix/simplify
Simplify expression in 'Tokenaizer::checked_next_byte'.
2 parents 884ec67 + 91b5bd8 commit 4398d77

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/parser.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,7 @@ impl<'a> Tokenizer<'a> {
131131

132132
#[inline(always)]
133133
fn checked_next_byte(&mut self) -> Option<u8> {
134-
if self.left_over.is_some() {
135-
let byte = self.left_over;
136-
self.left_over = None;
137-
return byte;
138-
}
139-
140-
self.next_byte()
134+
self.left_over.take().or_else(|| self.next_byte())
141135
}
142136

143137
#[inline(always)]

0 commit comments

Comments
 (0)