madrob commented on a change in pull request #1444: URL: https://github.com/apache/lucene-solr/pull/1444#discussion_r413933007
########## File path: lucene/expressions/src/java/org/apache/lucene/expressions/SimpleBindings.java ########## @@ -96,24 +90,51 @@ public DoubleValuesSource getDoubleValuesSource(String name) { case SCORE: return DoubleValuesSource.SCORES; default: - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } } - /** - * Traverses the graph of bindings, checking there are no cycles or missing references - * @throws IllegalArgumentException if the bindings is inconsistent + @Override + public DoubleValuesSource getDoubleValuesSource(String name) { + if (map.containsKey(name) == false) { Review comment: Is `containsKey` boolean check more clear than `get` with a null check? I think the latter is going to be more efficient because it's only a single map operation, but I guess this way might be better for the JVM's escape analysis? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org