This is an automated email from the ASF dual-hosted git repository.

gangwu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new 05b0f608 fix: use std::move when passing by value in the config (#555)
05b0f608 is described below

commit 05b0f6089a58ea8b189d45c6f1da5d653dc4d436
Author: 姚军 <[email protected]>
AuthorDate: Mon Feb 9 12:08:07 2026 +0800

    fix: use std::move when passing by value in the config (#555)
---
 src/iceberg/util/config.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/iceberg/util/config.h b/src/iceberg/util/config.h
index 5adbc96d..df92561b 100644
--- a/src/iceberg/util/config.h
+++ b/src/iceberg/util/config.h
@@ -67,10 +67,13 @@ class ConfigBase {
   template <typename T>
   class Entry {
    public:
-    Entry(std::string key, const T& val,
+    Entry(std::string key, T val,
           std::function<std::string(const T&)> to_str = 
internal::DefaultToString<T>,
           std::function<T(const std::string&)> from_str = 
internal::DefaultFromString<T>)
-        : key_{std::move(key)}, default_{val}, to_str_{to_str}, 
from_str_{from_str} {}
+        : key_{std::move(key)},
+          default_{std::move(val)},
+          to_str_{std::move(to_str)},
+          from_str_{std::move(from_str)} {}
 
    private:
     const std::string key_;

Reply via email to