From a3613f2a3c33567d30baaed37051fd8f47102e63 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 10 Nov 2024 20:52:05 +0100 Subject: [PATCH] autoCallFunction: accept const Bindings & It does not need to mutate the attrs. `const` is shallow. Avoids a const_cast in the hercules-ci-cnix-expr bindings. --- src/libexpr/eval.cc | 2 +- src/libexpr/eval.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index e4937735b..876ba32fa 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1730,7 +1730,7 @@ void EvalState::incrFunctionCall(ExprLambda * fun) } -void EvalState::autoCallFunction(Bindings & args, Value & fun, Value & res) +void EvalState::autoCallFunction(const Bindings & args, Value & fun, Value & res) { auto pos = fun.determinePos(noPos); diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index f7ed6be83..3171bf7fa 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -693,7 +693,7 @@ public: * Automatically call a function for which each argument has a * default value or has a binding in the `args` map. */ - void autoCallFunction(Bindings & args, Value & fun, Value & res); + void autoCallFunction(const Bindings & args, Value & fun, Value & res); /** * Allocation primitives.