From 493090894237037758b8fa066466e8797fd40656 Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Thu, 23 Apr 2020 15:57:16 -0700 Subject: [PATCH] new version of containsVariable, with better performance and somewhat better to debug --- src/storm/storage/expressions/Expression.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/storm/storage/expressions/Expression.cpp b/src/storm/storage/expressions/Expression.cpp index 0221628db..520bf1db4 100644 --- a/src/storm/storage/expressions/Expression.cpp +++ b/src/storm/storage/expressions/Expression.cpp @@ -133,9 +133,12 @@ namespace storm { bool Expression::containsVariable(std::set const& variables) const { std::set appearingVariables = this->getVariables(); - std::set intersection; - std::set_intersection(variables.begin(), variables.end(), appearingVariables.begin(), appearingVariables.end(), std::inserter(intersection, intersection.begin())); - return !intersection.empty(); + for (auto const& v : variables) { + if (appearingVariables.count(v) > 0) { + return true; + } + } + return false; } bool Expression::containsVariableInITEGuard(std::set const& variables) const {