13
0

search-path: filter out duplicates

Note: this does not yet take care of filtering dups
when directly combining two search-paths.
This commit is contained in:
Robin Gareus 2014-06-28 21:25:13 +02:00
parent dcca72dabd
commit 02e38bab16

View File

@ -52,9 +52,15 @@ Searchpath::Searchpath (const vector<std::string>& paths)
void
Searchpath::add_directory (const std::string& directory_path)
{
if (!directory_path.empty()) {
push_back(directory_path);
if (directory_path.empty()) {
return;
}
for (vector<std::string>::const_iterator i = begin(); i != end(); ++i) {
if (*i == directory_path) {
return;
}
}
push_back(directory_path);
}
void