Enable performance-unnecessary-value-param in .clang-tidy (#15026)

Summary:
This PR fixes around 250 places in the codebase where we were making unnecessary copies of objects (some large, some small).

ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15026

Differential Revision: D13458784

Pulled By: goldsborough

fbshipit-source-id: be5148b2ce09493588d70952e6f6d6ff5ec5199b
This commit is contained in:
Peter Goldsborough
2018-12-13 16:09:08 -08:00
committed by Facebook Github Bot
parent bdfff2f8c2
commit 1e9c384afb
78 changed files with 351 additions and 314 deletions
+2 -1
View File
@@ -240,7 +240,8 @@ TEST_F(ModuleTest, CallingCloneOnModuleThatDoesNotOverrideCloneThrows) {
TEST_F(ModuleTest, CallingCloneOnModuleThatDoesOverrideCloneDoesNotThrow) {
struct Cloneable : Module {
std::shared_ptr<Module> clone(
torch::optional<torch::Device> device = torch::nullopt) const override {
const torch::optional<torch::Device>& device =
torch::nullopt) const override {
return nullptr;
}
};