diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-03 08:09:57 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-04 20:32:17 (GMT) |
commit | fdca04db6850273157e3c50de476e0b9298e9948 (patch) | |
tree | 523b22649fa4f1ff25aa6b08251e8ca05b2f2bd7 /Source/cmPolicies.cxx | |
parent | a7ff97275159d094f55df481728a682c357bc438 (diff) | |
download | CMake-fdca04db6850273157e3c50de476e0b9298e9948.zip CMake-fdca04db6850273157e3c50de476e0b9298e9948.tar.gz CMake-fdca04db6850273157e3c50de476e0b9298e9948.tar.bz2 |
cmPolicies: Implement more-compact IsPolicyNewerThan.
Diffstat (limited to 'Source/cmPolicies.cxx')
-rw-r--r-- | Source/cmPolicies.cxx | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 6a15965..9250620 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -80,23 +80,12 @@ public: unsigned int minorV, unsigned int patchV) { - if (majorV < this->MajorVersionIntroduced) - { - return true; - } - if (majorV > this->MajorVersionIntroduced) - { - return false; - } - if (minorV < this->MinorVersionIntroduced) - { - return true; - } - if (minorV > this->MinorVersionIntroduced) - { - return false; - } - return (patchV < this->PatchVersionIntroduced); + return (majorV < this->MajorVersionIntroduced || + (majorV == this->MajorVersionIntroduced && + minorV < this->MinorVersionIntroduced) || + (majorV == this->MajorVersionIntroduced && + minorV == this->MinorVersionIntroduced && + patchV < this->PatchVersionIntroduced)); } cmPolicies::PolicyID ID; |