Skip to content

Commit 60e0142

Browse files
committed
further tweaks to stringreader
1 parent e84acb1 commit 60e0142

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SocketIOClientSwift/SocketStringReader.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ struct SocketStringReader {
4343
}
4444

4545
mutating func read(readLength: Int) -> String {
46-
let range = Range<String.Index>(start: currentIndex, end: currentIndex.advancedBy(readLength))
46+
let readString = message[currentIndex..<currentIndex.advancedBy(readLength)]
4747
advanceIndexBy(readLength)
4848

49-
return message.substringWithRange(range)
49+
return readString
5050
}
5151

5252
mutating func readUntilStringOccurence(string: String) -> String {

0 commit comments

Comments
 (0)