Skip to content

Commit 7edda4e

Browse files
committed
fix stuck formula generation
1 parent 2cf95c9 commit 7edda4e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ To install or update LODA, please follow the [installation instructions](https:/
22

33
## [Unreleased]
44

5+
### Bugfixes
6+
7+
* Fix stuck formula generation
8+
59
## v25.7.13
610

711
### Bugfixes

src/form/variant.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ bool VariantsManager::update(Variant new_variant) {
3838
new_variant.definition.name == new_variant.func) {
3939
return false;
4040
}
41-
collectFuncs(new_variant);
4241
const auto num_terms = new_variant.definition.numTerms();
42+
if (num_terms > 500) { // magic number
43+
Log::get().debug("Skipping variant with " + std::to_string(num_terms) +
44+
" terms");
45+
return false; // too many terms
46+
}
47+
collectFuncs(new_variant);
4348
// if (new_variant.used_funcs.size() > 3) { // magic number
4449
// return false;
4550
// }

0 commit comments

Comments
 (0)