Skip to content

Commit f0ac68e

Browse files
committed
simplify ranges
1 parent 11bc8e5 commit f0ac68e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Source/SocketIO/Parse/SocketParsable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public extension SocketParsable where Self: SocketManagerSpec & SocketDataBuffer
119119
}
120120
}
121121

122-
var dataArray = String(message.utf16[message.utf16.index(reader.currentIndex, offsetBy: 1)..<message.utf16.endIndex])!
122+
var dataArray = String(message.utf16[message.utf16.index(reader.currentIndex, offsetBy: 1)...])!
123123

124124
if type == .error && !dataArray.hasPrefix("[") && !dataArray.hasSuffix("]") {
125125
dataArray = "[" + dataArray + "]"

Source/SocketIO/Util/SocketStringReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct SocketStringReader {
5454
}
5555

5656
mutating func readUntilOccurence(of string: String) -> String {
57-
let substring = message.utf16[currentIndex..<message.utf16.endIndex]
57+
let substring = message.utf16[currentIndex...]
5858

5959
guard let foundIndex = substring.index(of: string.utf16.first!) else {
6060
currentIndex = message.utf16.endIndex

0 commit comments

Comments
 (0)