mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
isFunctor: Simplify
This commit is contained in:
parent
8a87521636
commit
51cf4455b2
2 changed files with 6 additions and 11 deletions
|
@ -78,15 +78,4 @@ inline void EvalState::forceList(Value & v, const Pos & pos)
|
||||||
throwTypeError("value is %1% while a list was expected, at %2%", v, pos);
|
throwTypeError("value is %1% while a list was expected, at %2%", v, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool EvalState::isFunctor(Value& fun)
|
|
||||||
{
|
|
||||||
if (fun.type == tAttrs) {
|
|
||||||
auto found = fun.attrs->find(sFunctor);
|
|
||||||
if (found != fun.attrs->end()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1291,6 +1291,12 @@ bool EvalState::forceBool(Value & v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool EvalState::isFunctor(Value & fun)
|
||||||
|
{
|
||||||
|
return fun.type == tAttrs && fun.attrs->find(sFunctor) != fun.attrs->end();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EvalState::forceFunction(Value & v, const Pos & pos)
|
void EvalState::forceFunction(Value & v, const Pos & pos)
|
||||||
{
|
{
|
||||||
forceValue(v);
|
forceValue(v);
|
||||||
|
|
Loading…
Reference in a new issue