mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-23 21:57:16 +01:00
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
1 changed files with 8 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue