retire-longinusx: a record names the retiring ones only by a whole string, not by a substring

The first dry run was refused by NameFile USA, whose name list holds longer strings
containing the words. A reference is a string equal to the id or the name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-08 13:57:31 +02:00
commit 8038b46aec

View file

@ -1116,8 +1116,9 @@ public static class Program
return 1;
}
// A needle is the whole serialized string: a name inside a longer string (a name list entry) is not a reference.
var needles = doomed.Select(d => d.Key.Value).Concat(new[] { "LonginusX", "Traction" })
.Select(System.Text.Encoding.UTF8.GetBytes).ToArray();
.Select(text => MessagePack.MessagePackSerializer.Serialize(text)).ToArray();
var doomedKeys = new HashSet<string>(doomed.Select(d => d.Key.Value));
var named = 0;
foreach (var other in stored.Where(d => !doomedKeys.Contains(d.Key.Value)))