diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-08-19 12:31:52 (GMT) |
---|---|---|
committer | Regina Pfeifer <regina@mailbox.org> | 2019-08-19 18:01:39 (GMT) |
commit | 2dfc52675c3ea732bd389852675e680e296415cb (patch) | |
tree | 23ff56e62d180ef60fe92b9e9d01878f9a96c36a /Source/cmXCodeObject.h | |
parent | c41c79285b5ebb7dd914a6e714aa553bb5078641 (diff) | |
download | CMake-2dfc52675c3ea732bd389852675e680e296415cb.zip CMake-2dfc52675c3ea732bd389852675e680e296415cb.tar.gz CMake-2dfc52675c3ea732bd389852675e680e296415cb.tar.bz2 |
cmAlgorithms: Add cmContains
Also, use the new function where applicable.
Diffstat (limited to 'Source/cmXCodeObject.h')
-rw-r--r-- | Source/cmXCodeObject.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index 51e5d36..0552676 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -12,6 +12,8 @@ #include <utility> #include <vector> +#include "cmAlgorithms.h" + class cmGeneratorTarget; class cmXCodeObject @@ -80,15 +82,10 @@ public: void SetObject(cmXCodeObject* value) { this->Object = value; } cmXCodeObject* GetObject() { return this->Object; } void AddObject(cmXCodeObject* value) { this->List.push_back(value); } - bool HasObject(cmXCodeObject* o) const - { - return !(std::find(this->List.begin(), this->List.end(), o) == - this->List.end()); - } + bool HasObject(cmXCodeObject* o) const { return cmContains(this->List, o); } void AddUniqueObject(cmXCodeObject* value) { - if (std::find(this->List.begin(), this->List.end(), value) == - this->List.end()) { + if (!cmContains(this->List, value)) { this->List.push_back(value); } } |