diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-27 14:50:17 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-27 17:12:43 (GMT) |
commit | 87341d8328c7b3a1d50cfd534ff4cb44334a2561 (patch) | |
tree | 83479c41db2da0c4282565927d60150f5e5ac727 /Source/cmDependsC.cxx | |
parent | 5a15c9e7cb63fb5b884271a1184607a8fa87d442 (diff) | |
download | CMake-87341d8328c7b3a1d50cfd534ff4cb44334a2561.zip CMake-87341d8328c7b3a1d50cfd534ff4cb44334a2561.tar.gz CMake-87341d8328c7b3a1d50cfd534ff4cb44334a2561.tar.bz2 |
cmDepends: Define DependencyMap instead of DependencyVector
In `cmDepends` use
`typedef std::map<std::string, std::vector<std::string>> DependencyMap`
instead of defining a
`class DependencyVector : public std::vector<std::string>`
and using it in `std::map<std::string, DependencyVector>`.
Since `std::map<std::string, std::vector<std::string>>` is used in various
other places, we now reuse all of it's auto generated methods. This doesn't
happen when we use `DependencyVector` in a `std::map`, because it is a
different class than `std::vector<std::string>`.
Diffstat (limited to 'Source/cmDependsC.cxx')
-rw-r--r-- | Source/cmDependsC.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 7b78767..dc49c18 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -21,9 +21,8 @@ cmDependsC::cmDependsC() = default; -cmDependsC::cmDependsC( - cmLocalGenerator* lg, const std::string& targetDir, const std::string& lang, - const std::map<std::string, DependencyVector>* validDeps) +cmDependsC::cmDependsC(cmLocalGenerator* lg, const std::string& targetDir, + const std::string& lang, const DependencyMap* validDeps) : cmDepends(lg, targetDir) , ValidDeps(validDeps) { @@ -102,8 +101,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, this->LocalGenerator->MaybeConvertToRelativePath(binDir, obj); if (this->ValidDeps != nullptr) { - std::map<std::string, DependencyVector>::const_iterator tmpIt = - this->ValidDeps->find(obj_i); + auto const tmpIt = this->ValidDeps->find(obj_i); if (tmpIt != this->ValidDeps->end()) { dependencies.insert(tmpIt->second.begin(), tmpIt->second.end()); haveDeps = true; |