Browse Source

Don't create appender when not needed, remove unused variable declaration

pull/328/head
jochenberger 8 years ago committed by GitHub
parent
commit
01118a7214
  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