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() {
|
||||
// initialize array
|
||||
std::vector<std::vector<int>> linesCompleteness;
|
||||
linesCompleteness.reserve(4);
|
||||
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);
|
||||
}
|
||||
std::vector<int> empty(this->length, 0);
|
||||
std::vector<std::vector<int>> linesCompleteness(4, empty);
|
||||
|
||||
// calculates amount of squares per rows and columns
|
||||
for (const Position position : *this) {
|
||||
|
||||
Reference in New Issue
Block a user