Skip to content

Commit

Permalink
perf: improve performance of getChar
Browse files Browse the repository at this point in the history
  • Loading branch information
kkebo committed May 4, 2024
1 parent 5ff6580 commit 0c882eb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Sources/Tokenizer/Tokenizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1210,9 +1210,7 @@ public struct Tokenizer<Sink: ~Copyable & TokenSink>: ~Copyable {
guard let reconsumeChar else {
guard let c = input.popFirst() else { return nil }
guard c != "\r" else {
if self.peek(input) == "\n" {
self.discardChar(&input)
}
if input.first == "\n" { input.removeFirst() }
return "\n"
}
switch c.value {
Expand Down

0 comments on commit 0c882eb

Please sign in to comment.