optimize vector initialization
All checks were successful
Linux arm64 / Build (push) Successful in 2m13s
All checks were successful
Linux arm64 / Build (push) Successful in 2m13s
This commit is contained in:
@@ -78,15 +78,8 @@ void Polyomino::rotateCCW() {
|
|||||||
|
|
||||||
void Polyomino::goToSpawnPosition() {
|
void Polyomino::goToSpawnPosition() {
|
||||||
// initialize array
|
// initialize array
|
||||||
std::vector<std::vector<int>> linesCompleteness;
|
std::vector<int> empty(this->length, 0);
|
||||||
linesCompleteness.reserve(4);
|
std::vector<std::vector<int>> linesCompleteness(4, empty);
|
||||||
std::vector<int> empty;
|
|
||||||
for (int j = 0; j < this->length; j++) {
|
|
||||||
empty.push_back(0);
|
|
||||||
}
|
|
||||||
for (int i = 0; i < 4; i++) {
|
|
||||||
linesCompleteness.push_back(empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
// calculates amount of squares per rows and columns
|
// calculates amount of squares per rows and columns
|
||||||
for (const Position position : *this) {
|
for (const Position position : *this) {
|
||||||
|
|||||||
Reference in New Issue
Block a user