Skip to content

Commit 2e441e1

Browse files
committed
tools: fix redundant-move warning in inspector
Currently, the following warning is generated from the inspector protocol: /out/Release/obj/gen/src/node/inspector/protocol/Protocol.cpp: In member function ‘virtual std::unique_ptr<node::inspector::protocol::Value> node::inspector::protocol::ListValue::clone() const’: /out/Release/obj/gen/src/node/inspector/protocol/Protocol.cpp:739:21: error: redundant move in return statement [-Werror=redundant-move] 739 | return std::move(result); | ~~~~~~~~~^~~~~~~~ This commit removes the move for DictionaryValue and ListValue. PR-URL: #32685 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
1 parent a7ae7aa commit 2e441e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/inspector_protocol/lib/Values_cpp.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ std::unique_ptr<Value> DictionaryValue::clone() const
606606
DCHECK(value != m_data.cend() && value->second);
607607
result->setValue(key, value->second->clone());
608608
}
609-
return std::move(result);
609+
return result;
610610
}
611611

612612
DictionaryValue::DictionaryValue()
@@ -647,7 +647,7 @@ std::unique_ptr<Value> ListValue::clone() const
647647
std::unique_ptr<ListValue> result = ListValue::create();
648648
for (const std::unique_ptr<protocol::Value>& value : m_data)
649649
result->pushValue(value->clone());
650-
return std::move(result);
650+
return result;
651651
}
652652

653653
ListValue::ListValue()

0 commit comments

Comments
 (0)