Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

Simplify loop in config.cpp #733

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ std::vector<std::string> GetConfigs()
pstring configDirectory = GetConfigDirectory();
std::vector<Config> vConfigs = GetConfigs(configDirectory.c_str());
std::vector<std::string> 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());

Expand All @@ -97,4 +98,4 @@ pstring GetGhConfigDirectory()
mkdir(directory.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);

return directory;
}
}