Skip to content

Apache Lucene open-source search software

dont call doExplain twice

Mark Robert Miller613aca947102
diff --git a/src/java/org/apache/lucene/search/function/CustomScoreQuery.java b/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
index 460bf9f91b1..365d46b52f3 100755
--- a/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
+++ b/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
@@ -349,7 +349,7 @@ public class CustomScoreQuery extends Query {
@Override
public Explanation explain(IndexReader reader, int doc) throws IOException {
Explanation explain = doExplain(reader, doc);
- return explain == null ? new Explanation(0.0f, "no matching docs") : doExplain(reader, doc);
+ return explain == null ? new Explanation(0.0f, "no matching docs") : explain;
}
private Explanation doExplain(IndexReader reader, int doc) throws IOException {