From 1472e045a757af4e289801673b456b78ebf18933 Mon Sep 17 00:00:00 2001 From: Kevin Amado Date: Fri, 21 Jan 2022 10:04:09 -0500 Subject: [PATCH] avoid unnecesary calls --- src/libexpr/eval-inline.hh | 16 ---------------- src/libexpr/eval.hh | 2 -- 2 files changed, 18 deletions(-) diff --git a/src/libexpr/eval-inline.hh b/src/libexpr/eval-inline.hh index cd58315ba..08acb0877 100644 --- a/src/libexpr/eval-inline.hh +++ b/src/libexpr/eval-inline.hh @@ -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) { 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) { forceValue(v, pos); diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index f0b94f440..11d62ba04 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -231,9 +231,7 @@ public: NixInt forceInt(Value & v, const Pos & pos); NixFloat forceFloat(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 forceList(Value & v); inline void forceList(Value & v, const Pos & pos); void forceFunction(Value & v, const Pos & pos); // either lambda or primop string forceString(Value & v, const Pos & pos = noPos);