Skip to content

Commit

Permalink
refactor: use string literals
Browse files Browse the repository at this point in the history
  • Loading branch information
kkebo committed Jun 30, 2024
1 parent 6387067 commit 56f9667
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/Tokenizer/Tokenizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public struct Tokenizer<Sink: ~Copyable & TokenSink>: ~Copyable {
self.emitsAllErrors = emitsAllErrors
self.state = .data
self.reconsumeChar = nil
self.tempBuffer = []
self.currentComment = []
self.currentTagName = []
self.tempBuffer = ""
self.currentComment = ""
self.currentTagName = ""
self.currentTagKind = .start
self.currentAttrName = []
self.currentAttrValue = []
self.currentAttrName = ""
self.currentAttrValue = ""
self.currentAttrs = [:]
self.lastStartTagName = nil
self.currentDOCTYPE = .init()
Expand Down Expand Up @@ -1506,7 +1506,7 @@ public struct Tokenizer<Sink: ~Copyable & TokenSink>: ~Copyable {
private mutating func clearPublicID() {
switch self.currentDOCTYPE.publicID {
case .some: self.currentDOCTYPE.publicID?.removeAll(keepingCapacity: true)
case .none: self.currentDOCTYPE.publicID = []
case .none: self.currentDOCTYPE.publicID = ""
}
}

Expand All @@ -1522,7 +1522,7 @@ public struct Tokenizer<Sink: ~Copyable & TokenSink>: ~Copyable {
private mutating func clearSystemID() {
switch self.currentDOCTYPE.systemID {
case .some: self.currentDOCTYPE.systemID?.removeAll(keepingCapacity: true)
case .none: self.currentDOCTYPE.systemID = []
case .none: self.currentDOCTYPE.systemID = ""
}
}

Expand Down

0 comments on commit 56f9667

Please sign in to comment.