mirror of https://github.com/apache/lucene.git
When evaluating expressions, defer calling advanceExact on operands until doubleValue() is called (#11878)
This commit is contained in:
parent
05bd83dfe1
commit
b3bc59910f
|
@ -39,21 +39,21 @@ class ExpressionFunctionValues extends DoubleValues {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean advanceExact(int doc) throws IOException {
|
||||
public boolean advanceExact(int doc) {
|
||||
if (currentDoc == doc) {
|
||||
return true;
|
||||
}
|
||||
for (DoubleValues v : functionValues) {
|
||||
v.advanceExact(doc);
|
||||
}
|
||||
currentDoc = doc;
|
||||
computed = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double doubleValue() {
|
||||
public double doubleValue() throws IOException {
|
||||
if (computed == false) {
|
||||
for (DoubleValues v : functionValues) {
|
||||
v.advanceExact(currentDoc);
|
||||
}
|
||||
currentValue = expression.evaluate(functionValues);
|
||||
computed = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue