[Variable] Use Swift split over Foundation

This commit is contained in:
Kyle Fuller
2015-11-21 14:42:51 +00:00
parent 3bd3aec296
commit 89b7da2e10

View File

@@ -6,7 +6,7 @@ class FilterExpression : Resolvable {
let variable: Variable let variable: Variable
init(token: String, parser: TokenParser) throws { init(token: String, parser: TokenParser) throws {
let bits = token.componentsSeparatedByString("|") let bits = token.characters.split("|").map(String.init)
if bits.isEmpty { if bits.isEmpty {
filters = [] filters = []
variable = Variable("") variable = Variable("")
@@ -43,7 +43,7 @@ public struct Variable : Equatable, Resolvable {
} }
private func lookup() -> [String] { private func lookup() -> [String] {
return variable.componentsSeparatedByString(".") return variable.characters.split(".").map(String.init)
} }
/// Resolve the variable in the given context /// Resolve the variable in the given context