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
|
@Override
|
||||||
public boolean advanceExact(int doc) throws IOException {
|
public boolean advanceExact(int doc) {
|
||||||
if (currentDoc == doc) {
|
if (currentDoc == doc) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
for (DoubleValues v : functionValues) {
|
|
||||||
v.advanceExact(doc);
|
|
||||||
}
|
|
||||||
currentDoc = doc;
|
currentDoc = doc;
|
||||||
computed = false;
|
computed = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double doubleValue() {
|
public double doubleValue() throws IOException {
|
||||||
if (computed == false) {
|
if (computed == false) {
|
||||||
|
for (DoubleValues v : functionValues) {
|
||||||
|
v.advanceExact(currentDoc);
|
||||||
|
}
|
||||||
currentValue = expression.evaluate(functionValues);
|
currentValue = expression.evaluate(functionValues);
|
||||||
computed = true;
|
computed = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue