From 51cf4455b2857efb6f3a2fda01b45baab2af7e73 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Oct 2015 13:22:11 +0200 Subject: isFunctor: Simplify --- src/libexpr/eval-inline.hh | 11 ----------- src/libexpr/eval.cc | 6 ++++++ 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'src/libexpr') diff --git a/src/libexpr/eval-inline.hh b/src/libexpr/eval-inline.hh index b470fa315d61..0748fbd3f3e1 100644 --- a/src/libexpr/eval-inline.hh +++ b/src/libexpr/eval-inline.hh @@ -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); } -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; -} - } diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 93c3111af3e4..fb96e8b4d78f 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -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) { forceValue(v); -- cgit 1.4.1