Skip to content

Commit 05b0f60

Browse files
authored
fix: use std::move when passing by value in the config (#555)
1 parent 43b83c5 commit 05b0f60

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/iceberg/util/config.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ class ConfigBase {
6767
template <typename T>
6868
class Entry {
6969
public:
70-
Entry(std::string key, const T& val,
70+
Entry(std::string key, T val,
7171
std::function<std::string(const T&)> to_str = internal::DefaultToString<T>,
7272
std::function<T(const std::string&)> from_str = internal::DefaultFromString<T>)
73-
: key_{std::move(key)}, default_{val}, to_str_{to_str}, from_str_{from_str} {}
73+
: key_{std::move(key)},
74+
default_{std::move(val)},
75+
to_str_{std::move(to_str)},
76+
from_str_{std::move(from_str)} {}
7477

7578
private:
7679
const std::string key_;

0 commit comments

Comments
 (0)