expansions: fix sort behavior
The previous implementation was wrong and led to segfaults when sorting large expansions
This commit is contained in:
parent
980dc72678
commit
b93fb41af2
2 changed files with 6 additions and 14 deletions
|
|
@ -504,13 +504,9 @@ namespace spot
|
||||||
{
|
{
|
||||||
std::sort(exp.begin(), exp.end(),
|
std::sort(exp.begin(), exp.end(),
|
||||||
[](const auto& lhs, const auto& rhs) {
|
[](const auto& lhs, const auto& rhs) {
|
||||||
bdd_less_than_stable blt;
|
return std::make_pair(lhs.first.id(), lhs.second.id())
|
||||||
// first sort by label, then by suffix
|
< std::make_pair(rhs.first.id(), rhs.second.id());
|
||||||
if (blt(lhs.first, rhs.first))
|
});
|
||||||
return true;
|
|
||||||
formula_ptr_less_than_bool_first flt;
|
|
||||||
return flt(lhs.second, rhs.second);
|
|
||||||
});
|
|
||||||
exp.erase(std::unique(exp.begin(), exp.end()), exp.end());
|
exp.erase(std::unique(exp.begin(), exp.end()), exp.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -503,13 +503,9 @@ namespace spot
|
||||||
{
|
{
|
||||||
std::sort(exp.begin(), exp.end(),
|
std::sort(exp.begin(), exp.end(),
|
||||||
[](const auto& lhs, const auto& rhs) {
|
[](const auto& lhs, const auto& rhs) {
|
||||||
bdd_less_than_stable blt;
|
return std::make_pair(lhs.first.id(), lhs.second.id())
|
||||||
// first sort by label, then by suffix
|
< std::make_pair(rhs.first.id(), rhs.second.id());
|
||||||
if (blt(lhs.first, rhs.first))
|
});
|
||||||
return true;
|
|
||||||
formula_ptr_less_than_bool_first flt;
|
|
||||||
return flt(lhs.second, rhs.second);
|
|
||||||
});
|
|
||||||
exp.erase(std::unique(exp.begin(), exp.end()), exp.end());
|
exp.erase(std::unique(exp.begin(), exp.end()), exp.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue