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:
parent
dcca72dabd
commit
02e38bab16
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user