fix(cache): Cache properly clears

Cache now clears properly when setting molar abundances
This commit is contained in:
2025-12-07 07:52:08 -05:00
parent 75ba6c8456
commit 51c6a97b47
2 changed files with 21 additions and 2 deletions

View File

@@ -604,6 +604,8 @@ namespace fourdst::composition {
LOG_ERROR(getLogger(), "Molar abundance must be non-negative for symbol {}. Currently it is {}.", species.name(), molar_abundance);
throw exceptions::InvalidCompositionError("Molar abundance must be non-negative, got " + std::to_string(molar_abundance) + " for symbol " + std::string(species.name()) + ".");
}
m_cache.clear();
m_molarAbundances.at(species) = molar_abundance;
}