Removed StringBuilder

This commit is contained in:
Nabil Chatbi 2018-04-01 01:33:11 +02:00
parent 09d21e835b
commit ae54062b0a
1 changed files with 8 additions and 4 deletions

View File

@ -119,19 +119,23 @@ public class QueryParser {
}
private func consumeSubQuery() -> String {
let sq: StringBuilder = StringBuilder()
var sq = ""
while (!tq.isEmpty()) {
if (tq.matches("(")) {
sq.append("(").append(tq.chompBalanced("(", ")")).append(")")
sq.append("(")
sq.append(tq.chompBalanced("(", ")"))
sq.append(")")
} else if (tq.matches("[")) {
sq.append("[").append(tq.chompBalanced("[", "]")).append("]")
sq.append("[")
sq.append(tq.chompBalanced("[", "]"))
sq.append("]")
} else if (tq.matchesAny(QueryParser.combinators)) {
break
} else {
sq.append(tq.consume())
}
}
return sq.toString()
return sq
}
private func findElements()throws {