Merge pull request #7888 from lioncash/const

UICommon/ResourcePack: Mark ResourcePack's operator== as const
This commit is contained in:
JosJuice 2019-03-13 21:41:07 +01:00 committed by GitHub
commit bc9e9caf19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -320,9 +320,14 @@ bool ResourcePack::Uninstall(const std::string& path)
return true;
}
bool ResourcePack::operator==(const ResourcePack& pack)
bool ResourcePack::operator==(const ResourcePack& pack) const
{
return pack.GetPath() == m_path;
}
bool ResourcePack::operator!=(const ResourcePack& pack) const
{
return !operator==(pack);
}
} // namespace ResourcePack

View File

@ -30,7 +30,8 @@ public:
bool Install(const std::string& path);
bool Uninstall(const std::string& path);
bool operator==(const ResourcePack& pack);
bool operator==(const ResourcePack& pack) const;
bool operator!=(const ResourcePack& pack) const;
private:
bool m_valid = true;