Skip to content

Commit ce674b5

Browse files
committed
Update constructor of jsont based on the copy and move idiom.
This improves the case where `jsont` is constructed based on the result of a function. In this case the copy will be elided and `value` will be initialised based on the move constructor.
1 parent 28117d2 commit ce674b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/json.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class jsont
117117
{
118118
}
119119

120-
jsont(kindt _kind, const std::string &_value):kind(_kind), value(_value)
120+
jsont(kindt _kind, std::string _value):kind(_kind), value(std::move(_value))
121121
{
122122
}
123123

0 commit comments

Comments
 (0)