mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared/expression_model_store] Better assertions
This commit is contained in:
committed by
LeaNumworks
parent
77cdc32813
commit
71e0c5a556
@@ -54,13 +54,12 @@ int ExpressionModelStore::numberOfModelsSatisfyingTest(ModelTest test) const {
|
||||
}
|
||||
|
||||
Ion::Storage::Record ExpressionModelStore::recordSatisfyingTestAtIndex(int i, ModelTest test) const {
|
||||
assert(i >= 0 && i < numberOfDefinedModels());
|
||||
assert(0 <= i && i < numberOfModelsSatisfyingTest(test));
|
||||
int index = 0;
|
||||
int currentModelIndex = 0;
|
||||
Ion::Storage::Record r = recordAtIndex(currentModelIndex++);
|
||||
ExpressionModelHandle * m = privateModelForRecord(r);
|
||||
while (!m->isNull()) {
|
||||
assert(currentModelIndex <= numberOfModels());
|
||||
if (test(m)) {
|
||||
if (i == index) {
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user