From 0565b5f2b35dc153dc98e1e3bd37476aa13ee4f1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 30 Nov 2006 22:43:55 +0000 Subject: * More remote operations. * Added new operation hasSubstitutes(), which is more efficient than querySubstitutes().size() > 0. --- src/nix-env/main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nix-env/main.cc') diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index ce0bef069708..a9f34387079b 100644 --- a/src/nix-env/main.cc +++ b/src/nix-env/main.cc @@ -832,18 +832,18 @@ static void opQuery(Globals & globals, XMLAttrs attrs; if (printStatus) { - Substitutes subs = store->querySubstitutes(i->queryOutPath(globals.state)); + bool hasSubs = store->hasSubstitutes(i->queryOutPath(globals.state)); bool isInstalled = installed.find(i->queryOutPath(globals.state)) != installed.end(); bool isValid = store->isValidPath(i->queryOutPath(globals.state)); if (xmlOutput) { attrs["installed"] = isInstalled ? "1" : "0"; attrs["valid"] = isValid ? "1" : "0"; - attrs["substitutable"] = !subs.empty() ? "1" : "0"; + attrs["substitutable"] = hasSubs ? "1" : "0"; } else columns.push_back( (string) (isInstalled ? "I" : "-") + (isValid ? "P" : "-") - + (!subs.empty() ? "S" : "-")); + + (hasSubs ? "S" : "-")); } if (xmlOutput) -- cgit 1.4.1