aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-11-14 16:52:15 +0100
committerGitHub <[email protected]>2023-11-14 16:52:15 +0100
commit01aedfc1c984427e7bb133539190347809b67e0e (patch)
treea423a425d44de021a05cd8db91f832ceac0fae6e /src
parent0.2.33-pre0 (diff)
downloadzen-01aedfc1c984427e7bb133539190347809b67e0e.tar.xz
zen-01aedfc1c984427e7bb133539190347809b67e0e.zip
fix comparison operator for cache disk location (#534)
* proper != operator for DiskLocation
Diffstat (limited to 'src')
-rw-r--r--src/zenserver/cache/cachedisklayer.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/zenserver/cache/cachedisklayer.h b/src/zenserver/cache/cachedisklayer.h
index d46d629e4..d9884a7bc 100644
--- a/src/zenserver/cache/cachedisklayer.h
+++ b/src/zenserver/cache/cachedisklayer.h
@@ -34,7 +34,18 @@ struct DiskLocation
this->Location.BlockLocation = BlockStoreDiskLocation(Location, PayloadAlignment);
}
- inline bool operator!=(const DiskLocation& Rhs) const { return memcmp(&Location, &Rhs.Location, sizeof(Location)) != 0; }
+ inline bool operator!=(const DiskLocation& Rhs) const
+ {
+ if (Flags != Rhs.Flags)
+ {
+ return true;
+ }
+ if (Flags & kStandaloneFile)
+ {
+ return Location.StandaloneSize != Rhs.Location.StandaloneSize;
+ }
+ return Location.BlockLocation != Rhs.Location.BlockLocation;
+ }
inline BlockStoreLocation GetBlockLocation(uint64_t PayloadAlignment) const
{