diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2020-04-06 14:21:08 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2020-05-04 14:23:27 +0200 |
commit | a87d3710148c0d1128e5372a1a8b90edd174a65d (patch) | |
tree | f3885d22e1d77560d49bc9f2c2d27d8f1bd4b8a7 | |
parent | f62d92b900eac7d8603817ea65e95e08678ff840 (diff) | |
download | node-new-a87d3710148c0d1128e5372a1a8b90edd174a65d.tar.gz |
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>
-rw-r--r-- | tools/inspector_protocol/lib/Values_cpp.template | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/inspector_protocol/lib/Values_cpp.template b/tools/inspector_protocol/lib/Values_cpp.template index 764b4d37d9..be3149d503 100644 --- a/tools/inspector_protocol/lib/Values_cpp.template +++ b/tools/inspector_protocol/lib/Values_cpp.template @@ -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() |