From 2c8106295d51cb51f158dfa7ff4fb5984c04a52f Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Wed, 13 Jan 2021 15:25:25 -0800 Subject: [PATCH] Add std::move() for args to an assign_to_index call --- src/Expr.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Expr.cc b/src/Expr.cc index 4db734f0ad..1a78ab02e9 100644 --- a/src/Expr.cc +++ b/src/Expr.cc @@ -208,7 +208,8 @@ void Expr::AssignToIndex(ValPtr v1, ValPtr v2, ValPtr v3) const { bool iterators_invalidated; - auto error_msg = assign_to_index(v1, v2, v3, iterators_invalidated); + auto error_msg = assign_to_index(std::move(v1), std::move(v2), std::move(v3), + iterators_invalidated); if ( iterators_invalidated ) { @@ -241,7 +242,7 @@ const char* assign_to_index(ValPtr v1, ValPtr v2, ValPtr v3, if ( ! v1 || ! v2 || ! v3 ) return nullptr; - // Hold an extra reference to 'arg_v' in case the ownership transfer + // Hold an extra reference in case the ownership transfer // to the table/vector goes wrong and we still want to obtain // diagnostic info from the original value after the assignment // already unref'd.