mirror of
https://github.com/aristocratos/btop.git
synced 2026-01-27 15:34:38 -05:00
Reserve known vector size
Allocate the required memory at once.
This commit is contained in:
@@ -694,7 +694,8 @@ namespace Config {
|
||||
std::ifstream cread(conf_file);
|
||||
if (cread.good()) {
|
||||
vector<string> valid_names;
|
||||
for (auto &n : descriptions)
|
||||
valid_names.reserve(descriptions.size());
|
||||
for (const auto &n : descriptions)
|
||||
valid_names.push_back(n[0]);
|
||||
if (string v_string; cread.peek() != '#' or (getline(cread, v_string, '\n') and not s_contains(v_string, Global::Version)))
|
||||
write_new = true;
|
||||
|
||||
Reference in New Issue
Block a user