From 86a32589e90ee983159fb5b2c6a594428ab7d422 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 Mar 2014 15:29:08 +0200 Subject: Find places where OUString and OString are passed by value. It's not very efficient, because we generally end up copying it twice - once into the parameter and again into the destination OUString. So I create a clang plugin that finds such places and generates a warning so that we can convert them to pass-by-reference. Change-Id: I5341a6ea9e3190f4b4c05c42c85595e3dcd83361 --- cppuhelper/source/servicemanager.cxx | 2 +- cppuhelper/source/servicemanager.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cppuhelper') diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index 6a4618cca476..2ef9dfbaf1db 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -1830,7 +1830,7 @@ bool cppuhelper::ServiceManager::removeLegacyFactory( return true; } -void cppuhelper::ServiceManager::removeImplementation(rtl::OUString name) { +void cppuhelper::ServiceManager::removeImplementation(const rtl::OUString & name) { // The underlying data structures make this function somewhat inefficient, // but the assumption is that it is rarely called: boost::shared_ptr< Data::Implementation > clear; diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx index e8446d6d7873..f62fe1dd7de2 100644 --- a/cppuhelper/source/servicemanager.hxx +++ b/cppuhelper/source/servicemanager.hxx @@ -367,7 +367,7 @@ private: css::uno::Reference< css::lang::XServiceInfo > const & factoryInfo, bool removeListener); - void removeImplementation(rtl::OUString name); + void removeImplementation(const rtl::OUString & name); boost::shared_ptr< Data::Implementation > findServiceImplementation( css::uno::Reference< css::uno::XComponentContext > const & context, -- cgit