From 68bb2f677095f4e45b87d92918af0d22d3578ff8 Mon Sep 17 00:00:00 2001 From: kiokumicu Date: Thu, 9 Jun 2016 16:56:32 +0300 Subject: [PATCH] Update to 05-03 snapshot * Updating to 04-25 snapshot * Updating to 05.03 snapshot --- .swift-version | 2 +- Package.swift | 2 +- Sources/Parser.swift | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.swift-version b/.swift-version index 11b6ddd..917e99e 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -DEVELOPMENT-SNAPSHOT-2016-04-12-a +DEVELOPMENT-SNAPSHOT-2016-05-03-a \ No newline at end of file diff --git a/Package.swift b/Package.swift index 97ab80e..c72843b 100644 --- a/Package.swift +++ b/Package.swift @@ -3,6 +3,6 @@ import PackageDescription let package = Package( name: "Redis", dependencies: [ - .Package(url: "https://github.com/VeniceX/TCP.git", majorVersion: 0, minor: 5) + .Package(url: "https://github.com/VeniceX/TCP.git", majorVersion: 0, minor: 7) ] ) diff --git a/Sources/Parser.swift b/Sources/Parser.swift index a02ae85..fb1e31a 100644 --- a/Sources/Parser.swift +++ b/Sources/Parser.swift @@ -3,7 +3,7 @@ extension String { public func indexOf(character char: Character) -> Int? { if let idx = self.characters.index(of: char) { - return self.startIndex.distance(to: idx) + return self.distance(from: self.startIndex, to: idx) } return nil } @@ -21,7 +21,7 @@ struct Parser { static func readResponse(_ fullResponse: String) throws -> Any? { let byte: Character = fullResponse[fullResponse.startIndex] - let response: String = fullResponse[fullResponse.startIndex.advanced(by: 1).. 0 { var tmp: [Any?] = [] - let tail: Int = Int(String(values[0][values[0].startIndex.advanced(by: 1)]))! + let tail: Int = Int(String(values[0][values[0].index(values[0].startIndex, offsetBy: 1)]))! values.remove(at: 0) while tmp.count < tail {