marcoabreu closed pull request #12730: [MXNET-860] Remove std::moves that have no affect URL: https://github.com/apache/incubator-mxnet/pull/12730
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/.clang-tidy b/.clang-tidy index 0080662285b..25fbff9f1a4 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -55,7 +55,7 @@ Checks: > # In order to trigger an error, you must have a rule defined both in checks and in this section. WarningsAsErrors: > cppcoreguidelines-no-malloc, modernize-use-nullptr, performance-unnecessary-copy-initialization, - modernize-use-emplace + modernize-use-emplace, performance-move-const-arg # Todo: define a better regex match that includes most project headers, but excludes third party # code. diff --git a/src/executor/infer_graph_attr_pass.cc b/src/executor/infer_graph_attr_pass.cc index 0abee04b59d..c14482affbd 100644 --- a/src/executor/infer_graph_attr_pass.cc +++ b/src/executor/infer_graph_attr_pass.cc @@ -330,7 +330,7 @@ nnvm::Graph InferShape(nnvm::Graph&& graph, graph.attrs["shape_inputs"] = std::make_shared<any>(std::move(shape_inputs)); } if (shape_attr_key.length() != 0) { - graph.attrs["shape_attr_key"] = std::make_shared<any>(std::move(shape_attr_key)); + graph.attrs["shape_attr_key"] = std::make_shared<any>(shape_attr_key); } return InferAttr<nnvm::TShape, nnvm::FInferShape>( std::move(graph), nnvm::TShape(), @@ -348,7 +348,7 @@ nnvm::Graph InferType(nnvm::Graph&& graph, graph.attrs["dtype_inputs"] = std::make_shared<any>(std::move(dtype_inputs)); } if (dtype_attr_key.length() != 0) { - graph.attrs["dtype_attr_key"] = std::make_shared<any>(std::move(dtype_attr_key)); + graph.attrs["dtype_attr_key"] = std::make_shared<any>(dtype_attr_key); } return InferAttr<int, nnvm::FInferType>( std::move(graph), -1, @@ -366,7 +366,7 @@ nnvm::Graph InferStorageType(nnvm::Graph&& graph, graph.attrs["storage_type_inputs"] = std::make_shared<any>(std::move(storage_type_inputs)); } if (storage_type_attr_key.length() != 0) { - graph.attrs["storage_type_attr_key"] = std::make_shared<any>(std::move(storage_type_attr_key)); + graph.attrs["storage_type_attr_key"] = std::make_shared<any>(storage_type_attr_key); } // initialize unknown values for dispatch modes if (graph.attrs.count("dispatch_mode") == 0) { diff --git a/src/operator/tensor/elemwise_unary_op.h b/src/operator/tensor/elemwise_unary_op.h index eb070a41127..83b86bf1d94 100644 --- a/src/operator/tensor/elemwise_unary_op.h +++ b/src/operator/tensor/elemwise_unary_op.h @@ -126,10 +126,10 @@ class OpBase { in_blobs.reserve(inputs.size()); out_blobs.reserve(outputs.size()); for (size_t i = 0, n = inputs.size(); i < n; ++i) { - in_blobs.emplace_back(std::move(inputs[i].data())); + in_blobs.emplace_back(inputs[i].data()); } for (size_t i = 0, n = outputs.size(); i < n; ++i) { - out_blobs.emplace_back(std::move(outputs[i].data())); + out_blobs.emplace_back(outputs[i].data()); } computer(attrs, ctx, in_blobs, req, out_blobs); } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services