CopiedHoldIds: the copied.Length == 0 early-out is deleted; an empty copy runs the loop zero times

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-15 00:23:25 +02:00
commit fa90c6cc1e

View file

@ -4280,7 +4280,7 @@ namespace GameCult.Caching
// order, so the decode runs only where it can change the answer.
private bool CopiedHoldIds(Durable? durable, CultPersistedRecord[] copied, IReadOnlyCollection<CultStagedRecord> upserts)
{
if (durable == null || copied.Length == 0 ||
if (durable == null ||
string.Equals(durable.Snapshot.FormatVersion, CultPersistedStoreSnapshot.FormatV3, StringComparison.Ordinal) ||
upserts.Any(staged => staged.HoldsIds == true) ||
AttachedRegistry is not { } registry)