summaryrefslogtreecommitdiff
path: root/i18npool/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-03-06 15:29:08 +0200
committerNoel Grandin <noel@peralex.com>2014-03-18 08:32:26 +0200
commit86a32589e90ee983159fb5b2c6a594428ab7d422 (patch)
tree6de946fe2b9b25614f0d197af95e9d3aadcd1bd9 /i18npool/source
parentbb17844099ba98a77c8e5d7a25c0c416a4b0641e (diff)
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
Diffstat (limited to 'i18npool/source')
-rw-r--r--i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx2
-rw-r--r--i18npool/source/localedata/localedata.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index e58afe75efc0..8a110c040a51 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -521,7 +521,7 @@ void lcl_formatCharsGR(const sal_Unicode table[], int n, OUString& s )
}
static
-bool should_ignore( OUString s )
+bool should_ignore( const OUString& s )
{
// return true if blank or null
return s == " " || (!s.isEmpty() && s[0]==0);
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index b9748c7472f1..a45bab178575 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -1383,7 +1383,7 @@ public:
virtual sal_Bool SAL_CALL hasElements( ) throw(RuntimeException, std::exception);
};
-static sal_Char* U2C( OUString str )
+static sal_Char* U2C( const OUString& str )
{
sal_Char* s = new sal_Char[ str.getLength()+1 ];
int i;