Skip to content

Commit 1879a8d

Browse files
author
thk123
committed
Correct clang-tidy errors about move semantics
1 parent 6c238cd commit 1879a8d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/util/structured_data.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ structured_data_entryt structured_data_entryt::data_node(const jsont &data)
7171
structured_data_entryt
7272
structured_data_entryt::entry(std::map<labelt, structured_data_entryt> children)
7373
{
74-
return structured_data_entryt(children);
74+
return structured_data_entryt(std::move(children));
7575
}
7676

77-
structured_data_entryt::structured_data_entryt(const jsont &data) : data(data)
77+
structured_data_entryt::structured_data_entryt(jsont data)
78+
: data(std::move(data))
7879
{
7980
}
8081

@@ -123,7 +124,7 @@ pretty_node(const std::pair<labelt, structured_data_entryt> &entry)
123124
}
124125
else
125126
{
126-
const auto indent = [](const std::string line) { return "\t" + line; };
127+
const auto indent = [](const std::string &line) { return "\t" + line; };
127128

128129
const auto &children = data.children();
129130
std::vector<std::vector<std::string>> lines =

src/util/structured_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct structured_data_entryt
4141
const std::map<labelt, structured_data_entryt> &children() const;
4242

4343
private:
44-
explicit structured_data_entryt(const jsont &data);
44+
explicit structured_data_entryt(jsont data);
4545
explicit structured_data_entryt(
4646
std::map<labelt, structured_data_entryt> children);
4747

0 commit comments

Comments
 (0)