1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-10 12:36:01 +01:00

Simplify RegisterCommand

This commit is contained in:
Eelco Dolstra 2025-05-05 08:28:12 +02:00
parent 4de7a986d4
commit e7c0906521
2 changed files with 8 additions and 7 deletions

View file

@ -14,12 +14,10 @@
namespace nix {
RegisterCommand::Commands * RegisterCommand::commands = nullptr;
nix::Commands RegisterCommand::getCommandsFor(const std::vector<std::string> & prefix)
{
nix::Commands res;
for (auto & [name, command] : *RegisterCommand::commands)
for (auto & [name, command] : RegisterCommand::commands())
if (name.size() == prefix.size() + 1) {
bool equal = true;
for (size_t i = 0; i < prefix.size(); ++i)