[Variable] Use Swift split over Foundation
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user