Refactor 2026 Day06 dictionary merge to reuse existing value

This commit is contained in:
Sebastian Lindemeier committed 2026-12-06 17:12:35 +01:00
1 parent bfbd68bd83
commit 2f10206d01
1 file changed
+1 -1
+1 -1
View File
@@ -36,7 +36,7 @@ public class Day06 : IPuzzleSolver<string>
HashSet<TValue> value) where TKey : notnull HashSet<TValue> value) where TKey : notnull
{ {
if(dictionary.TryGetValue(key, out var existing)) if(dictionary.TryGetValue(key, out var existing))
dictionary[key].UnionWith(value); existing.UnionWith(value);
else else
dictionary[key] = value; dictionary[key] = value;
} }