mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-29 09:06:15 +02:00
remove some dead code in nix/repl.cc
Fixes a static analyzer warning:
Expression 'isDrv' is always false.
Fixes: 3beb6f6e7
('Show derivations more concisely')
This commit is contained in:
parent
ff342fc0c2
commit
93c9ba3e78
1 changed files with 1 additions and 18 deletions
|
@ -643,30 +643,13 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m
|
||||||
for (auto & i : *v.attrs)
|
for (auto & i : *v.attrs)
|
||||||
sorted[i.name] = i.value;
|
sorted[i.name] = i.value;
|
||||||
|
|
||||||
/* If this is a derivation, then don't show the
|
|
||||||
self-references ("all", "out", etc.). */
|
|
||||||
StringSet hidden;
|
|
||||||
if (isDrv) {
|
|
||||||
hidden.insert("all");
|
|
||||||
Bindings::iterator i = v.attrs->find(state.sOutputs);
|
|
||||||
if (i == v.attrs->end())
|
|
||||||
hidden.insert("out");
|
|
||||||
else {
|
|
||||||
state.forceList(*i->value);
|
|
||||||
for (unsigned int j = 0; j < i->value->listSize(); ++j)
|
|
||||||
hidden.insert(state.forceStringNoCtx(*i->value->listElems()[j]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto & i : sorted) {
|
for (auto & i : sorted) {
|
||||||
if (isVarName(i.first))
|
if (isVarName(i.first))
|
||||||
str << i.first;
|
str << i.first;
|
||||||
else
|
else
|
||||||
printStringValue(str, i.first.c_str());
|
printStringValue(str, i.first.c_str());
|
||||||
str << " = ";
|
str << " = ";
|
||||||
if (hidden.find(i.first) != hidden.end())
|
if (seen.find(i.second) != seen.end())
|
||||||
str << "«...»";
|
|
||||||
else if (seen.find(i.second) != seen.end())
|
|
||||||
str << "«repeated»";
|
str << "«repeated»";
|
||||||
else
|
else
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue