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 --- stoc/source/inspect/introspection.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'stoc') diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 09dc11ba9e54..6361044d42b8 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -137,7 +137,7 @@ sal_Bool isDerivedFrom( Reference xToTestClass, Reference // Hashtable for the search of names struct hashName_Impl { - size_t operator()(const OUString Str) const + size_t operator()(const OUString& Str) const { return (size_t)Str.hashCode(); } @@ -145,7 +145,7 @@ struct hashName_Impl struct eqName_Impl { - sal_Bool operator()(const OUString Str1, const OUString Str2) const + sal_Bool operator()(const OUString& Str1, const OUString& Str2) const { return ( Str1 == Str2 ); } @@ -1411,7 +1411,7 @@ Any ImplIntrospectionAccess::getMaterial(void) throw(RuntimeException, std::exce } // Hilfs-Funktion zur LowerCase-Wandlung eines OUString -OUString toLower( OUString aUStr ) +OUString toLower( const OUString& aUStr ) { // Tabelle fuer XExactName pflegen OUString aOWStr( aUStr.getStr() ); -- cgit