Fix: Use modern comparisons instead of memcmp in cache check.

This uses C++20 default operator<=> to provide comparisons of some objects.

This works properly with caches that containers.
This commit is contained in:
Peter Nelson
2024-04-16 20:57:12 +01:00
committed by Peter Nelson
parent 21d11ee361
commit 3b75d8bbf8
8 changed files with 36 additions and 14 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ CompanyManagerFace ConvertFromOldCompanyManagerFace(uint32_t face)
void AfterLoadCompanyStats()
{
/* Reset infrastructure statistics to zero. */
for (Company *c : Company::Iterate()) MemSetT(&c->infrastructure, 0);
for (Company *c : Company::Iterate()) c->infrastructure = {};
/* Collect airport count. */
for (const Station *st : Station::Iterate()) {