summaryrefslogtreecommitdiff
path: root/lib/dir_exist_async.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:35 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:35 +0200
commit460091fb0b2ff114cc741372f15bb43b702ea3b1 (patch)
tree0562c2eda4c66969c6e6d0910080db9f5b0def3e /lib/dir_exist_async.h
parent5.15 (diff)
downloadFreeFileSync-460091fb0b2ff114cc741372f15bb43b702ea3b1.tar.gz
FreeFileSync-460091fb0b2ff114cc741372f15bb43b702ea3b1.tar.bz2
FreeFileSync-460091fb0b2ff114cc741372f15bb43b702ea3b1.zip
5.16
Diffstat (limited to 'lib/dir_exist_async.h')
-rw-r--r--lib/dir_exist_async.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/dir_exist_async.h b/lib/dir_exist_async.h
index 678a0235..b96dc7e1 100644
--- a/lib/dir_exist_async.h
+++ b/lib/dir_exist_async.h
@@ -20,7 +20,8 @@ namespace
//directory existence checking may hang for non-existent network drives => run asynchronously and update UI!
//- check existence of all directories in parallel! (avoid adding up search times if multiple network drives are not reachable)
//- add reasonable time-out time!
-std::set<Zstring, LessFilename> getExistingDirsUpdating(const std::vector<Zstring>& dirnames, bool allowUserInteraction, ProcessCallback& procCallback)
+//- avoid checking duplicate entries by design: set<Zstring, LessFilename>
+std::set<Zstring, LessFilename> getExistingDirsUpdating(const std::set<Zstring, LessFilename>& dirnames, bool allowUserInteraction, ProcessCallback& procCallback)
{
using namespace zen;
@@ -64,8 +65,8 @@ std::set<Zstring, LessFilename> getExistingDirsUpdating(const std::vector<Zstrin
inline //also silences Clang "unused function" for compilation units depending from getExistingDirsUpdating() only
bool dirExistsUpdating(const Zstring& dirname, bool allowUserInteraction, ProcessCallback& procCallback)
{
- std::vector<Zstring> dirnames;
- dirnames.push_back(dirname);
+ std::set<Zstring, LessFilename> dirnames;
+ dirnames.insert(dirname);
std::set<Zstring, LessFilename> dirsEx = getExistingDirsUpdating(dirnames, allowUserInteraction, procCallback);
return dirsEx.find(dirname) != dirsEx.end();
}
bgstack15