From d678d110b60aba04cfa46b3dff5e4aa44ce1c2e9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 27 Nov 2020 17:57:50 +0100 Subject: Avoid unnecessary copies --- .clang-tidy | 1 - src/JackDriver.cpp | 4 +++- src/JackDriver.hpp | 2 +- src/Widget.hpp | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 03effaf..fedd900 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -43,7 +43,6 @@ Checks: > -llvmlibc-*, -misc-unused-parameters, -modernize-use-trailing-return-type, - -performance-unnecessary-value-param, -readability-convert-member-functions-to-static, -readability-implicit-bool-conversion, -readability-inconsistent-declaration-parameter-name, diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index 648640f..48f3b9c 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -203,7 +203,9 @@ get_property(jack_uuid_t subject, const char* key) #endif PatchagePort* -JackDriver::create_port(PatchageModule& parent, jack_port_t* port, PortID id) +JackDriver::create_port(PatchageModule& parent, + jack_port_t* port, + const PortID& id) { if (!port) { return nullptr; diff --git a/src/JackDriver.hpp b/src/JackDriver.hpp index 6a404a7..75f189c 100644 --- a/src/JackDriver.hpp +++ b/src/JackDriver.hpp @@ -77,7 +77,7 @@ public: private: PatchagePort* - create_port(PatchageModule& parent, jack_port_t* port, PortID id); + create_port(PatchageModule& parent, jack_port_t* port, const PortID& id); void shutdown(); diff --git a/src/Widget.hpp b/src/Widget.hpp index 03c5f8e..f1db218 100644 --- a/src/Widget.hpp +++ b/src/Widget.hpp @@ -1,5 +1,5 @@ /* This file is part of Patchage - * Copyright 2007-2014 David Robillard + * Copyright 2007-2020 David Robillard * * Patchage is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free @@ -25,7 +25,7 @@ template class Widget { public: - Widget(Glib::RefPtr xml, const std::string& name) + Widget(const Glib::RefPtr& xml, const std::string& name) { xml->get_widget(name, _me); } -- cgit v1.2.1