Browse Source

Merge pull request #328 from jochenberger/patch-8

Don't create appender when not needed, remove unused variable declation
pull/329/head
kallestenflo 7 years ago committed by GitHub
parent
commit
37bdc37460
  1. 3
      json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java

3
json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java

@ -109,7 +109,6 @@ public class PathCompiler {
} }
RootPathToken pathToken = PathTokenFactory.createRootPathToken(path.currentChar()); RootPathToken pathToken = PathTokenFactory.createRootPathToken(path.currentChar());
PathTokenAppender appender = pathToken.getPathTokenAppender();
if (path.currentIsTail()) { if (path.currentIsTail()) {
return pathToken; return pathToken;
@ -121,6 +120,7 @@ public class PathCompiler {
fail("Illegal character at position " + path.position() + " expected '.' or '["); fail("Illegal character at position " + path.position() + " expected '.' or '[");
} }
PathTokenAppender appender = pathToken.getPathTokenAppender();
readNextToken(appender); readNextToken(appender);
return pathToken; return pathToken;
@ -267,7 +267,6 @@ public class PathCompiler {
* an array. * an array.
*/ */
private List<Parameter> parseFunctionParameters(String funcName) { private List<Parameter> parseFunctionParameters(String funcName) {
PathToken currentToken;
ParamType type = null; ParamType type = null;
// Parenthesis starts at 1 since we're marking the start of a function call, the close paren will denote the // Parenthesis starts at 1 since we're marking the start of a function call, the close paren will denote the

Loading…
Cancel
Save