fix reference to popped queue element
This commit is contained in:
parent
c8470bb8dc
commit
234217e6cc
|
@ -128,7 +128,7 @@ auto SolveMaze(Distances const& distances, bool const recursive) -> std::int64_t
|
||||||
todo.emplace(0, 0, "-AA");
|
todo.emplace(0, 0, "-AA");
|
||||||
|
|
||||||
while(!todo.empty()) {
|
while(!todo.empty()) {
|
||||||
auto const& [steps, depth, name] = todo.top();
|
auto const [steps, depth, name] = std::move(todo.top());
|
||||||
todo.pop();
|
todo.pop();
|
||||||
if (name == "-ZZ") { return steps; }
|
if (name == "-ZZ") { return steps; }
|
||||||
if (seen.emplace(depth, name).second) {
|
if (seen.emplace(depth, name).second) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user