mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Code review tweaks
This commit is contained in:
parent
15037b782f
commit
8040cafb3d
@ -61,16 +61,14 @@ std::string CModVersion::toString() const
|
||||
|
||||
bool CModVersion::compatible(const CModVersion & other, bool checkMinor, bool checkPatch) const
|
||||
{
|
||||
if(minor == Any || other.minor == Any)
|
||||
checkMinor = false;
|
||||
if(patch == Any || other.patch == Any)
|
||||
checkPatch = false;
|
||||
bool doCheckMinor = checkMinor && minor != Any && other.minor != Any;
|
||||
bool doCheckPatch = checkPatch && patch != Any && other.patch != Any;
|
||||
|
||||
assert(!checkPatch || (checkPatch && checkMinor));
|
||||
assert(!doCheckPatch || (doCheckPatch && doCheckMinor));
|
||||
|
||||
return (major == other.major &&
|
||||
(!checkMinor || minor >= other.minor) &&
|
||||
(!checkPatch || minor > other.minor || (minor == other.minor && patch >= other.patch)));
|
||||
(!doCheckMinor || minor >= other.minor) &&
|
||||
(!doCheckPatch || minor > other.minor || (minor == other.minor && patch >= other.patch)));
|
||||
}
|
||||
|
||||
bool CModVersion::isNull() const
|
||||
|
Loading…
Reference in New Issue
Block a user