cmPolicies: Implement more-compact IsPolicyNewerThan.

This commit is contained in:
Stephen Kelly 2015-05-03 10:09:57 +02:00
parent a7ff972751
commit fdca04db68
1 changed files with 6 additions and 17 deletions

View File

@ -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;