diff options
author | Ben Burdette <bburdette@protonmail.com> | 2022-07-11 10:21:40 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@protonmail.com> | 2022-07-11 10:21:40 -0600 |
commit | 6ac8200ff5d21d7c4464b4b3a2d3716fa4b942fd (patch) | |
tree | 6a9b620427a6ce2fc5605e82e1e31937a5fea7ce /src/libexpr/primops.cc | |
parent | 69ea265fd26e6b503bb52566ce6f5f12e0a75661 (diff) |
use util.hh class instead of local
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index ecc1c136a..3a07e43a7 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -846,15 +846,6 @@ static RegisterPrimOp primop_floor({ .fun = prim_floor, }); -class Counter -{ - private: - int &counter; - public: - Counter(int &counter) :counter(counter) { counter++; } - ~Counter() { counter--; } -}; - /* Try evaluating the argument. Success => {success=true; value=something;}, * else => {success=false; value=false;} */ static void prim_tryEval(EvalState & state, const PosIdx pos, Value * * args, Value & v) @@ -862,7 +853,7 @@ static void prim_tryEval(EvalState & state, const PosIdx pos, Value * * args, Va auto attrs = state.buildBindings(2); /* increment state.trylevel, and decrement it when this function returns. */ - Counter trylevel(state.trylevel); + MaintainCount trylevel(state.trylevel); void (* savedDebugRepl)(ref<EvalState> es, const ValMap & extraEnv) = nullptr; if (state.debugRepl && state.ignoreTry) |