From fca58aa0449f68537a372b2744c323338f7a859a Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Tue, 2 Sep 2025 15:53:30 -0700 Subject: [PATCH] main: don't insert null function pointers into the legacy commands map This is purely aesthetically bothering me, but [] inserting stuff into the map is such a C++ coded design decision and we don't intend to mutate it here so we probably should not do it. Change-Id: Idf37c51175b031fb396e8fd53dc8fe6f2039fb55 --- lix/nix/main.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lix/nix/main.cc b/lix/nix/main.cc index 75a6b12dc..f404762b8 100644 --- a/lix/nix/main.cc +++ b/lix/nix/main.cc @@ -488,9 +488,9 @@ int mainWrapped(AsyncIoRoot & aio, int argc, char ** argv) { registerLegacyCommands(); - auto legacy = (*LegacyCommandRegistry::commands)[programName]; + auto legacy = nix::get(*LegacyCommandRegistry::commands, programName); if (legacy) { - return legacy( + return (*legacy)( aio, std::string(baseNameOf(argv[0])), Strings(argv + 1, argv + argc),