Closed perryhoekstra closed 6 years ago
Maybe something like this:
if let endIndex = lineEndIndex { buffer.removeSubrange(buffer.startIndex ..< min(endIndex, buffer.endIndex)) }
@perryhoekstra Could you provide either the content of buffer
when the crash occurred or the string that you appended to ChunkBuffer
before the crash?
@vldalx The buffer is an empty string
In 2.0.1, I am seeing a crash in ChunkBuffer.swift
if let endIndex = lineEndIndex { buffer.removeSubrange(buffer.startIndex ..< endIndex) }
The error is:
Fatal error: replaceSubrange: subrange extends past String end