Prevent unnecessary copy

This commit is contained in:
2019-12-15 18:25:28 +01:00
parent 55f39d896f
commit 1d0fae267b

View File

@@ -145,7 +145,7 @@ void aoc2019::day15_part1(std::istream &input, std::ostream &output) {
void aoc2019::day15_part2(std::istream &input, std::ostream &output) {
const auto map = read_map(input);
auto starting_point = std::find_if(map.begin(), map.end(), [](auto x) { return x.second == Tile::Oxygen; })->first;
auto starting_point = std::find_if(map.begin(), map.end(), [](auto &x) { return x.second == Tile::Oxygen; })->first;
auto dist = bfs(map, starting_point, [](Tile x) { return false; });