diff --git a/src/config.cpp b/src/config.cpp index 89c1bc949..1438bcd18 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -74,9 +74,10 @@ std::vector GetConfigs() pstring configDirectory = GetConfigDirectory(); std::vector vConfigs = GetConfigs(configDirectory.c_str()); std::vector configs; + configs.reserve(vConfigs.size()); - for (auto config = vConfigs.begin(); config != vConfigs.end(); config++) - configs.push_back(config->name); + for (auto const &config: vConfigs) + configs.push_back(config.name); std::sort(configs.begin(), configs.end()); @@ -97,4 +98,4 @@ pstring GetGhConfigDirectory() mkdir(directory.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); return directory; -} \ No newline at end of file +}