Skip to content

Commit dd617de

Browse files
Skylion007henryiii
authored andcommitted
fix: missing move in eval.h (#3775)
1 parent 45219c6 commit dd617de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/pybind11/eval.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ template <eval_mode mode = eval_expr, size_t N>
8282
object eval(const char (&s)[N], object global = globals(), object local = object()) {
8383
/* Support raw string literals by removing common leading whitespace */
8484
auto expr = (s[0] == '\n') ? str(module_::import("textwrap").attr("dedent")(s)) : str(s);
85-
return eval<mode>(expr, global, local);
85+
return eval<mode>(expr, std::move(global), std::move(local));
8686
}
8787

8888
inline void exec(const str &expr, object global = globals(), object local = object()) {
@@ -91,7 +91,7 @@ inline void exec(const str &expr, object global = globals(), object local = obje
9191

9292
template <size_t N>
9393
void exec(const char (&s)[N], object global = globals(), object local = object()) {
94-
eval<eval_statements>(s, global, local);
94+
eval<eval_statements>(s, std::move(global), std::move(local));
9595
}
9696

9797
#if defined(PYPY_VERSION) && PY_VERSION_HEX >= 0x03000000

0 commit comments

Comments
 (0)