diff --git a/src/generator/NextStateGenerator.cpp b/src/generator/NextStateGenerator.cpp index a99f0dcea..54fb2f280 100644 --- a/src/generator/NextStateGenerator.cpp +++ b/src/generator/NextStateGenerator.cpp @@ -250,10 +250,6 @@ namespace storm { template storm::models::sparse::StateLabeling NextStateGenerator::label(storm::storage::BitVectorHashMap const& states, std::vector const& initialStateIndices, std::vector const& deadlockStateIndices, std::vector> labelsAndExpressions) { - // Make the labels unique. - std::sort(labelsAndExpressions.begin(), labelsAndExpressions.end(), [] (std::pair const& a, std::pair const& b) { return a.first < b.first; } ); - auto it = std::unique(labelsAndExpressions.begin(), labelsAndExpressions.end(), [] (std::pair const& a, std::pair const& b) { return a.first == b.first; } ); - labelsAndExpressions.resize(std::distance(labelsAndExpressions.begin(), it)); for (auto const& expression : this->options.getExpressionLabels()) { std::stringstream stream; @@ -261,6 +257,11 @@ namespace storm { labelsAndExpressions.push_back(std::make_pair(stream.str(), expression)); } + // Make the labels unique. + std::sort(labelsAndExpressions.begin(), labelsAndExpressions.end(), [] (std::pair const& a, std::pair const& b) { return a.first < b.first; } ); + auto it = std::unique(labelsAndExpressions.begin(), labelsAndExpressions.end(), [] (std::pair const& a, std::pair const& b) { return a.first == b.first; } ); + labelsAndExpressions.resize(std::distance(labelsAndExpressions.begin(), it)); + // Prepare result. storm::models::sparse::StateLabeling result(states.size()); @@ -306,4 +307,4 @@ namespace storm { template class NextStateGenerator; } -} \ No newline at end of file +}