Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Sources/TOMLDecoder/Parsing/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1100,8 +1100,6 @@ extension Token {
var index = text.lowerBound
var endIndex = text.upperBound

assert(quoteChar == CodeUnits.doubleQuote || quoteChar == CodeUnits.singleQuote)

if endIndex - index >= 3 && bytes[index] == CodeUnits.doubleQuote && bytes[index + 1] == CodeUnits.doubleQuote && bytes[index + 2] == CodeUnits.doubleQuote ||
endIndex - index >= 3 && bytes[index] == CodeUnits.singleQuote && bytes[index + 1] == CodeUnits.singleQuote && bytes[index + 2] == CodeUnits.singleQuote
{
Expand All @@ -1117,7 +1115,7 @@ extension Token {
} else {
index = index + 1
endIndex = endIndex - 1
guard bytes[endIndex] == quoteChar else {
guard endIndex >= 0, bytes[endIndex] == quoteChar else {
throw TOMLError(.invalidString(context: context, lineNumber: lineNumber, reason: "missing closing quote"))
}
}
Expand Down
Loading