replace push_back with emplace_back

This commit is contained in:
Corentin Jabot 2021-07-06 10:07:35 +02:00
parent 3197f334d1
commit 510e12a921

View file

@ -73,7 +73,7 @@ std::vector<GridPosition> Board::initialPelletPositions() {
for (std::size_t row = 0; row < ROWS; row++) { for (std::size_t row = 0; row < ROWS; row++) {
for (std::size_t column = 0; column < COLUMNS; column++) { for (std::size_t column = 0; column < COLUMNS; column++) {
if (board[row][column] == int(Cell::pellet)) if (board[row][column] == int(Cell::pellet))
positions.push_back({ int(column), int(row) }); positions.emplace_back(column, row);
} }
} }
return positions; return positions;
@ -84,7 +84,7 @@ std::vector<GridPosition> Board::initialSuperPelletPositions() {
for (std::size_t row = 0; row < ROWS; row++) { for (std::size_t row = 0; row < ROWS; row++) {
for (std::size_t column = 0; column < COLUMNS; column++) { for (std::size_t column = 0; column < COLUMNS; column++) {
if (board[row][column] == int(Cell::power_pellet)) if (board[row][column] == int(Cell::power_pellet))
positions.push_back({ int(column), int(row) }); positions.emplace_back(column, row);
} }
} }
return positions; return positions;