u01: Don’t call make_pair explicitly

This commit is contained in:
Simon Bruder 2023-04-24 14:20:42 +02:00
parent f7e5769f8d
commit 9db38c33f5

View file

@ -65,7 +65,7 @@ std::string node::print_recursive(unsigned int depth,
std::string node::print_iterative() const {
std::stringstream output;
std::stack<std::pair<const node *, unsigned int>> stack;
stack.push(std::make_pair(this, 0));
stack.push({this, 0});
std::set<const node *> visited = {};
while (!stack.empty()) {
@ -81,7 +81,7 @@ std::string node::print_iterative() const {
// to achieve the same output as the recursive approach.
// Otherwise, the order of the children is reversed (due to LIFO).
for (std::size_t i = n->get_nr_children(); i > 0; i--) {
stack.push(std::make_pair(n->get_child(i - 1), depth + 1));
stack.push({n->get_child(i - 1), depth + 1});
}
} else {
output << " [↝ " << n->get_name() << "]";