Cleaned up all the places I was doing push_back({constructorvar1, constructorvar2}) to use emplace_back(constructorvar1, constructorvar2) every other use should be only for actually copying.
This commit is contained in:
parent
18a5f6bfa9
commit
3344181a47
6 changed files with 18 additions and 23 deletions
|
@ -9,7 +9,7 @@ inline void add_neighbors(PointList &neighbors, Matrix &closed, size_t y, size_t
|
|||
for(matrix::box it{closed, x, y, 1}; it.next();) {
|
||||
if(closed[it.y][it.x] == 0) {
|
||||
closed[it.y][it.x] = 1;
|
||||
neighbors.push_back({.x=it.x, .y=it.y});
|
||||
neighbors.emplace_back(it.x, it.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ void Pathing::compute_paths(Matrix &walls) {
|
|||
if($input[y][x] == 0) {
|
||||
$paths[y][x] = 0;
|
||||
closed[y][x] = 1;
|
||||
starting_pixels.push_back({x,y});
|
||||
starting_pixels.emplace_back(x,y);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue