summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-06-18 12:56:29 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-24 09:45:22 +0200
commit51fb76a0beacee9d8a43abca493af1b8d2652b53 (patch)
tree5be89a5c743fef0d48ecb272f18ddbc8fa68db5d
parentc2291931213ae990d599b6889d3dd01ce4feb53f (diff)
fdo#76260 - the wrong way to get a 10% win with an N^3 operation.
Micro optimising the inner-loop is never the right way; on the other hand this is 10% of load time and is waste. (cherry picked from commit 78378af1d404baf78f42930a29dbf8eae22bbe80) Signed-off-by: Miklos Vajna <vmiklos@collabora.co.uk> Change-Id: Ie275be53e30834cbb6576b8e7580c16d2e47bf16
-rw-r--r--sw/inc/pagedesc.hxx1
-rw-r--r--sw/source/core/doc/docdesc.cxx2
2 files changed, 2 insertions, 1 deletions
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index a15a851181a9..58ab7a802f64 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -162,6 +162,7 @@ protected:
public:
OUString GetName() const { return aDescName; }
+ bool HasName( const OUString& rThisName ) { return aDescName == rThisName; }
void SetName( const OUString& rNewName ) { aDescName = rNewName; }
bool GetLandscape() const { return bLandscape; }
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 062fba30165a..bb8dd2df340f 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -638,7 +638,7 @@ SwPageDesc* SwDoc::FindPageDescByName( const OUString& rName, sal_uInt16* pPos )
if( pPos ) *pPos = USHRT_MAX;
for( sal_uInt16 n = 0, nEnd = maPageDescs.size(); n < nEnd; ++n )
- if( maPageDescs[ n ]->GetName() == rName )
+ if( maPageDescs[ n ]->HasName( rName ) )
{
pRet = maPageDescs[ n ];
if( pPos )