From 849690c814fefe3850c758565f8eab413c7d2737 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 11 May 2026 14:35:02 +0200 Subject: [PATCH] refactor(vfx #C.1.5a): reuse SequencerFactory's capturedDats in resolver Code-review follow-up to 65d833d: ResolveDefaultScript was closing over its own var capturedDatsForActivator = _dats, but the sibling SequencerFactory in the same block already declared var capturedDats = _dats. The two locals pointed at the same reference and served the same purpose; the alias added no value and muddied the closure pattern. Reuse capturedDats. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/AcDream.App/Rendering/GameWindow.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 14463e8..e679b92 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -1620,12 +1620,11 @@ public sealed class GameWindow : IDisposable // are initialised earlier in OnLoad (line ~1083); both are non-null // here. The resolver lambda captures _dats and swallows dat-lookup // throws — see C.1.5a spec §6 (error handling) for rationale. - var capturedDatsForActivator = _dats; uint ResolveDefaultScript(AcDream.Core.World.WorldEntity e) { try { - var setup = capturedDatsForActivator?.Get(e.SourceGfxObjOrSetupId); + var setup = capturedDats?.Get(e.SourceGfxObjOrSetupId); return setup?.DefaultScript.DataId ?? 0u; } catch