mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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: https://github.com/nodejs/node/pull/32685
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
This commit is contained in:
1 parent
a7ae7aab59
commit
2e441e152f
1 file changed
+2
-2
@@ -606,7 +606,7 @@ std::unique_ptr<Value> DictionaryValue::clone() const
|
||||
DCHECK(value != m_data.cend() && value->second);
|
||||
result->setValue(key, value->second->clone());
|
||||
}
|
||||
return std::move(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
DictionaryValue::DictionaryValue()
|
||||
@@ -647,7 +647,7 @@ std::unique_ptr<Value> ListValue::clone() const
|
||||
std::unique_ptr<ListValue> result = ListValue::create();
|
||||
for (const std::unique_ptr<protocol::Value>& value : m_data)
|
||||
result->pushValue(value->clone());
|
||||
return std::move(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
ListValue::ListValue()
|
||||
|
||||
Reference in new issue
Block a user