Skip to content

Commit

Permalink
Use String.split() instead of NSString.components() (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianpartridge authored Jan 29, 2019
1 parent e2d8983 commit f5aba72
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Sources/KituraNet/HTTPParser/URLParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,11 @@ public class URLParser : CustomStringConvertible {
}

if let query = query {
let pairs = query.components(separatedBy: "&")
let pairs = query.split(separator: "&")
for pair in pairs {

let pairArray = pair.components(separatedBy: "=")
let pairArray = pair.split(separator: "=")
if pairArray.count == 2 {
queryParameters[pairArray[0]] = pairArray[1]
queryParameters[String(pairArray[0])] = String(pairArray[1])
}
}
}
Expand Down

0 comments on commit f5aba72

Please sign in to comment.