aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-03 22:02:39 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-20 09:09:11 -0500
commit57a2e46ee0890093c9882f961d7d95c56d7c0ad5 (patch)
treeea9785416ae7c7cdf3c121f8c5064af70736e2e4
parentfa4733fce5e473901ccb5dfd08593c861a4e1f0e (diff)
Slight cleanup of `InstallablesCommand::load`
-rw-r--r--src/libcmd/installables.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index 5603a4f2b..cfc13a60f 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -708,8 +708,8 @@ void InstallablesCommand::prepare()
installables = load();
}
-Installables InstallablesCommand::load() {
- Installables installables;
+Installables InstallablesCommand::load()
+{
if (_installables.empty() && useDefaultInstallables())
// FIXME: commands like "nix profile install" should not have a
// default, probably.
@@ -719,11 +719,8 @@ Installables InstallablesCommand::load() {
std::vector<std::string> InstallablesCommand::getFlakesForCompletion()
{
- if (_installables.empty()) {
- if (useDefaultInstallables())
- return {"."};
- return {};
- }
+ if (_installables.empty() && useDefaultInstallables())
+ return {"."};
return _installables;
}