Skip to content

Commit

Permalink
Refactor to never push to front
Browse files Browse the repository at this point in the history
  • Loading branch information
Adda0 committed Sep 8, 2023
1 parent 7cd3a6f commit 9796bdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/mata/parser/inter-aut.hh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public:
*/
struct FormulaGraph {
FormulaNode node{};
std::deque<FormulaGraph> children{};
std::vector<FormulaGraph> children{};

FormulaGraph() = default;
FormulaGraph(const FormulaNode& n) : node(n), children() {}
Expand Down
6 changes: 4 additions & 2 deletions src/inter-aut.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,12 @@ namespace {
break;
default:
assert(opstack.size() > 1);
gr.children.emplace_back(std::move(opstack.back()));
mata::FormulaGraph second_child{ std::move(opstack.back()) };
opstack.pop_back();
gr.children.emplace_front(std::move(opstack.back()));
mata::FormulaGraph first_child{ std::move(opstack.back()) };
opstack.pop_back();
gr.children.emplace_back(std::move(first_child));
gr.children.emplace_back(std::move(second_child));
opstack.emplace_back(std::move(gr));
}
break;
Expand Down

0 comments on commit 9796bdb

Please sign in to comment.