From 5fb3fca2baf7ff256fd3df53909069a5699361a9 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 29 Sep 2026 18:14:24 +0200 Subject: [PATCH] Normalise a blank name once, where it is read The held-ancestor path compared the raw empty string, so a blank variant name and a blank held base name never met the blank rule; NameRead now returns null for blank on both paths. Co-Authored-By: Claude Sonnet 5 --- src/GameCult.Caching/CultCache.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/GameCult.Caching/CultCache.cs b/src/GameCult.Caching/CultCache.cs index f9497cb3..245e9367 100644 --- a/src/GameCult.Caching/CultCache.cs +++ b/src/GameCult.Caching/CultCache.cs @@ -2549,9 +2549,7 @@ namespace GameCult.Caching foreach (var stored in plan.Admitted.Concat(plan.Dependents)) { var descriptor = stored.Descriptor; - string? name = null; - if (descriptor.NameAccessor != null) - name = NameRead(stored) is { Length: > 0 } read ? read : null; + var name = descriptor.NameAccessor == null ? null : NameRead(stored); var indexes = new List<(string Alias, string Value)>(); foreach (var pair in descriptor.IndexAccessors) { @@ -2565,8 +2563,9 @@ namespace GameCult.Caching } } + // A blank name is no name. private static string? NameRead(CultStoredDocument stored) => - Read(stored, $"[CultName] member {stored.Descriptor.NameMember}", stored.Descriptor.NameAccessor!); + Read(stored, $"[CultName] member {stored.Descriptor.NameMember}", stored.Descriptor.NameAccessor!) is { Length: > 0 } name ? name : null; private static string? Read(CultStoredDocument stored, string what, Func getter) {