Skip to content

Commit a37af42

Browse files
committed
Get rid of move constructors
1 parent db4d56f commit a37af42

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

clang-tools-extra/clang-doc/HTMLMustacheGenerator.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ static json::Value extractValue(const TypedefInfo &I) {
209209

210210
static json::Value extractValue(const CommentInfo &I) {
211211
Object Obj = Object();
212-
Object Child;
212+
213+
json::Value ChildVal = Object();
214+
Object &Child = *ChildVal.getAsObject();
213215

214216
json::Value ChildArr = Array();
215217
auto &CARef = *ChildArr.getAsArray();
@@ -226,19 +228,19 @@ static json::Value extractValue(const CommentInfo &I) {
226228
case CommentKind::CK_BlockCommandComment: {
227229
Child.insert({"Command", I.Name});
228230
Child.insert({"Children", ChildArr});
229-
Obj.insert({commentKindToString(I.Kind), json::Value(std::move(Child))});
231+
Obj.insert({commentKindToString(I.Kind), ChildVal});
230232
return Obj;
231233
}
232234

233235
case CommentKind::CK_InlineCommandComment: {
234236
json::Value ArgsArr = Array();
235-
for (const auto &Arg : I.Args) {
237+
for (const auto &Arg : I.Args)
236238
ArgsArr.getAsArray()->emplace_back(Arg);
237-
}
239+
238240
Child.insert({"Command", I.Name});
239241
Child.insert({"Args", ArgsArr});
240242
Child.insert({"Children", ChildArr});
241-
Obj.insert({commentKindToString(I.Kind), json::Value(std::move(Child))});
243+
Obj.insert({commentKindToString(I.Kind), ChildVal});
242244
return Obj;
243245
}
244246

@@ -248,24 +250,24 @@ static json::Value extractValue(const CommentInfo &I) {
248250
Child.insert({"Direction", I.Direction});
249251
Child.insert({"Explicit", I.Explicit});
250252
Child.insert({"Children", ChildArr});
251-
Obj.insert({commentKindToString(I.Kind), json::Value(std::move(Child))});
253+
Obj.insert({commentKindToString(I.Kind), ChildVal});
252254
return Obj;
253255
}
254256

255257
case CommentKind::CK_VerbatimBlockComment: {
256258
Child.insert({"Text", I.Text});
257-
Child.insert({"Children", ChildArr});
258259
if (!I.CloseName.empty())
259260
Child.insert({"CloseName", I.CloseName});
260-
Obj.insert({commentKindToString(I.Kind), json::Value(std::move(Child))});
261+
Child.insert({"Children", ChildArr});
262+
Obj.insert({commentKindToString(I.Kind), ChildVal});
261263
return Obj;
262264
}
263265

264266
case CommentKind::CK_VerbatimBlockLineComment:
265267
case CommentKind::CK_VerbatimLineComment: {
266268
Child.insert({"Text", I.Text});
267269
Child.insert({"Children", ChildArr});
268-
Obj.insert({commentKindToString(I.Kind), json::Value(std::move(Child))});
270+
Obj.insert({commentKindToString(I.Kind), ChildVal});
269271
return Obj;
270272
}
271273

@@ -283,21 +285,21 @@ static json::Value extractValue(const CommentInfo &I) {
283285
Child.insert({"AttrKeys", AttrKeysArray});
284286
Child.insert({"AttrValues", AttrValuesArray});
285287
Child.insert({"Children", ChildArr});
286-
Obj.insert({commentKindToString(I.Kind), json::Value(std::move(Child))});
288+
Obj.insert({commentKindToString(I.Kind), ChildVal});
287289
return Obj;
288290
}
289291

290292
case CommentKind::CK_HTMLEndTagComment: {
291293
Child.insert({"Name", I.Name});
292294
Child.insert({"Children", ChildArr});
293-
Obj.insert({commentKindToString(I.Kind), json::Value(std::move(Child))});
295+
Obj.insert({commentKindToString(I.Kind), ChildVal});
294296
return Obj;
295297
}
296298

297299
case CommentKind::CK_FullComment:
298300
case CommentKind::CK_ParagraphComment: {
299301
Child.insert({"Children", ChildArr});
300-
Obj.insert({commentKindToString(I.Kind), json::Value(std::move(Child))});
302+
Obj.insert({commentKindToString(I.Kind), ChildVal});
301303
return Obj;
302304
}
303305

0 commit comments

Comments
 (0)