Skip to content

Commit

Permalink
Make the CKey operator== a friend instead of a member.
Browse files Browse the repository at this point in the history
  • Loading branch information
henricj committed Aug 31, 2024
1 parent e5d424b commit 6bfb2d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,8 @@ CAdPlugDatabase::CKey::CKey(binistream &buf)
make(buf);
}

bool CAdPlugDatabase::CKey::operator==(const CKey &key)
{
return ((crc16 == key.crc16) && (crc32 == key.crc32));
bool operator==(const CAdPlugDatabase::CKey& a, const CAdPlugDatabase::CKey& b) {
return ((a.crc16 == b.crc16) && (a.crc32 == b.crc32));
}

void CAdPlugDatabase::CKey::make(binistream &buf)
Expand Down
2 changes: 1 addition & 1 deletion src/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CAdPlugDatabase
CKey() {};
CKey(binistream &in);

bool operator==(const CKey &key);
friend bool operator==(const CKey& a, const CKey &b);

private:
void make(binistream &in);
Expand Down

0 comments on commit 6bfb2d5

Please sign in to comment.