if (session_dirs.size() == 1) {
switch (type) {
case DataType::AUDIO:
- s.push_back ( _session_dir->sound_path());
+ s.push_back (_session_dir->sound_path());
break;
case DataType::MIDI:
s.push_back (_session_dir->midi_path());
if (type == DataType::AUDIO) {
const string sound_path_2X = _session_dir->sound_path_2X();
if (Glib::file_test (sound_path_2X, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) {
- s.push_back (sound_path_2X);
+ if (find (s.begin(), s.end(), sound_path_2X) == s.end()) {
+ s.push_back (sound_path_2X);
+ }
}
}
}
for (vector<string>::iterator i = dirs.begin(); i != dirs.end(); ++i) {
-
- vector<string>::iterator si;
-
- for (si = s.begin(); si != s.end(); ++si) {
- if ((*si) == *i) {
- break;
- }
- }
-
- if (si == s.end()) {
+ if (find (s.begin(), s.end(), *i) == s.end()) {
s.push_back (*i);
}
}