mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-29 19:49:58 +02:00
[apps/shared/expression_model_store] Simplify recordSatisfyingTestAtIndex
This commit is contained in:
committed by
LeaNumworks
parent
526aa7ed48
commit
d4e129e162
@@ -59,21 +59,22 @@ Ion::Storage::Record ExpressionModelStore::recordSatisfyingTestAtIndex(int i, Mo
|
||||
assert(0 <= i && i < numberOfModelsSatisfyingTest(test));
|
||||
int index = 0;
|
||||
int currentModelIndex = 0;
|
||||
Ion::Storage::Record record;
|
||||
do {
|
||||
Ion::Storage::Record r = recordAtIndex(currentModelIndex++);
|
||||
ExpressionModelHandle * m = privateModelForRecord(r);
|
||||
record = recordAtIndex(currentModelIndex++);
|
||||
ExpressionModelHandle * m = privateModelForRecord(record);
|
||||
if (m->isNull()) {
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
if (test(m)) {
|
||||
if (i == index) {
|
||||
return r;
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
} while (true);
|
||||
assert(false);
|
||||
return Ion::Storage::Record();
|
||||
return record;
|
||||
}
|
||||
|
||||
void ExpressionModelStore::resetMemoizedModelsExceptRecord(const Ion::Storage::Record record) const {
|
||||
|
||||
Reference in New Issue
Block a user