diff options
author | Noel Grandin <noel@peralex.com> | 2014-03-06 15:29:08 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-03-18 08:32:26 +0200 |
commit | 86a32589e90ee983159fb5b2c6a594428ab7d422 (patch) | |
tree | 6de946fe2b9b25614f0d197af95e9d3aadcd1bd9 /sax | |
parent | bb17844099ba98a77c8e5d7a25c0c416a4b0641e (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 'sax')
-rw-r--r-- | sax/qa/cppunit/parser.cxx | 4 | ||||
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sax/qa/cppunit/parser.cxx b/sax/qa/cppunit/parser.cxx index 5ee1613f2674..74ab76a8ac5d 100644 --- a/sax/qa/cppunit/parser.cxx +++ b/sax/qa/cppunit/parser.cxx @@ -39,7 +39,7 @@ public: CPPUNIT_TEST_SUITE_END(); private: - uno::Reference< io::XInputStream > createStream(OString sInput); + uno::Reference< io::XInputStream > createStream(const OString& sInput); }; void ParserTest::setUp() @@ -55,7 +55,7 @@ void ParserTest::tearDown() test::BootstrapFixture::tearDown(); } -uno::Reference< io::XInputStream > ParserTest::createStream(OString sInput) +uno::Reference< io::XInputStream > ParserTest::createStream(const OString& sInput) { uno::Reference< io::XOutputStream > xPipe( io::Pipe::create(m_xContext) ); uno::Reference< io::XInputStream > xInStream( xPipe, uno::UNO_QUERY ); diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index a262d2a896c9..fb3445be4402 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -614,7 +614,7 @@ css::uno::Sequence< OUString > SaxExpatParser::getSupportedServiceNames(void) th * * *-------------------------------------------*/ -OUString getErrorMessage( XML_Error xmlE, OUString sSystemId , sal_Int32 nLine ) +OUString getErrorMessage( XML_Error xmlE, const OUString& sSystemId , sal_Int32 nLine ) { OUString Message; if( XML_ERROR_NONE == xmlE ) { |