Skip to content

Commit 7197091

Browse files
author
Felipe Zimmerle
committed
Using `clear' to clean up lists instead of clean via integration
1 parent 163483e commit 7197091

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/collections.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ Collections::Collections() {
3838

3939

4040
Collections::~Collections() {
41-
for (auto &a : *this) {
42-
this->erase(a.first);
43-
delete a.second;
41+
for (const auto &thing : *this) {
42+
delete thing.second;
4443
}
44+
this->clear();
4545
}
4646

4747

src/variables.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ Variables::Variables() {
3535
}
3636

3737
Variables::~Variables() {
38-
for (auto &a : *this) {
39-
this->erase(a.first);
40-
}
38+
this->clear();
4139
}
4240

4341
void Variables::store(std::string key, std::string value) {

0 commit comments

Comments
 (0)