avoid unnecesary calls

This commit is contained in:
Kevin Amado 2022-01-21 10:04:09 -05:00
parent 49b0bb0206
commit 1472e045a7
No known key found for this signature in database
GPG key ID: FFF341057F503148
2 changed files with 0 additions and 18 deletions

View file

@ -51,14 +51,6 @@ void EvalState::forceValue(Value & v, const Pos & pos)
} }
inline void EvalState::forceAttrs(Value & v)
{
forceValue(v, v.determinePos(noPos));
if (v.type() != nAttrs)
throwTypeError("value is %1% while a set was expected", v);
}
inline void EvalState::forceAttrs(Value & v, const Pos & pos) inline void EvalState::forceAttrs(Value & v, const Pos & pos)
{ {
forceValue(v, pos); forceValue(v, pos);
@ -67,14 +59,6 @@ inline void EvalState::forceAttrs(Value & v, const Pos & pos)
} }
inline void EvalState::forceList(Value & v)
{
forceValue(v, v.determinePos(noPos));
if (!v.isList())
throwTypeError("value is %1% while a list was expected", v);
}
inline void EvalState::forceList(Value & v, const Pos & pos) inline void EvalState::forceList(Value & v, const Pos & pos)
{ {
forceValue(v, pos); forceValue(v, pos);

View file

@ -231,9 +231,7 @@ public:
NixInt forceInt(Value & v, const Pos & pos); NixInt forceInt(Value & v, const Pos & pos);
NixFloat forceFloat(Value & v, const Pos & pos); NixFloat forceFloat(Value & v, const Pos & pos);
bool forceBool(Value & v, const Pos & pos); bool forceBool(Value & v, const Pos & pos);
inline void forceAttrs(Value & v);
inline void forceAttrs(Value & v, const Pos & pos); inline void forceAttrs(Value & v, const Pos & pos);
inline void forceList(Value & v);
inline void forceList(Value & v, const Pos & pos); inline void forceList(Value & v, const Pos & pos);
void forceFunction(Value & v, const Pos & pos); // either lambda or primop void forceFunction(Value & v, const Pos & pos); // either lambda or primop
string forceString(Value & v, const Pos & pos = noPos); string forceString(Value & v, const Pos & pos = noPos);