diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-09-07 19:03:18 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-09-08 21:46:45 (GMT) |
commit | 52052ef88b6f46a12c8430395ae8b419971fcb35 (patch) | |
tree | f3bdd792999040f1e896e72ad7115863e74c2181 /Source/cmGeneratorTarget.cxx | |
parent | 3b3622305bb950f16f238f030c8f32786ad3511a (diff) | |
download | CMake-52052ef88b6f46a12c8430395ae8b419971fcb35.zip CMake-52052ef88b6f46a12c8430395ae8b419971fcb35.tar.gz CMake-52052ef88b6f46a12c8430395ae8b419971fcb35.tar.bz2 |
cmGeneratorTarget: use erase-unique instead of reinitialization
Just to make it easier to find places where containers are cleared in
order to be recomputed.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 25917f8..4baec03 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -839,14 +839,10 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory( &dagChecker, result, excludeImported); } - std::set<std::string> unique; - for (std::vector<std::string>::iterator li = result.begin(); - li != result.end(); ++li) { - cmSystemTools::ConvertToUnixSlashes(*li); - unique.insert(*li); - } - result.clear(); - result.insert(result.end(), unique.begin(), unique.end()); + std::for_each(result.begin(), result.end(), + cmSystemTools::ConvertToUnixSlashes); + std::sort(result.begin(), result.end()); + result.erase(std::unique(result.begin(), result.end()), result.end()); IncludeCacheType::value_type entry(config_upper, result); iter = this->SystemIncludesCache.insert(entry).first; |