File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -50,18 +50,16 @@ struct SocketStringReader {
50
50
}
51
51
52
52
mutating func readUntilStringOccurence( string: String ) -> String {
53
- let range = Range < String . Index > ( start: currentIndex, end: message. endIndex)
54
- let subString = message. substringWithRange ( range)
55
- guard let foundRange = subString. rangeOfString ( string) else {
56
- let restOfString = message [ currentIndex..< message. endIndex]
53
+ let substring = message [ currentIndex..< message. endIndex]
54
+ guard let foundRange = substring. rangeOfString ( string) else {
57
55
currentIndex = message. endIndex
58
56
59
- return restOfString
57
+ return substring
60
58
}
61
59
62
60
advanceIndexBy ( message. startIndex. distanceTo ( foundRange. startIndex) + 1 )
63
61
64
- return subString . substringToIndex ( foundRange. startIndex)
62
+ return substring . substringToIndex ( foundRange. startIndex)
65
63
}
66
64
67
65
mutating func readUntilEnd( ) -> String {
You can’t perform that action at this time.
0 commit comments