diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2014-06-18 12:56:29 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2014-06-23 15:42:44 +0100 |
commit | 78378af1d404baf78f42930a29dbf8eae22bbe80 (patch) | |
tree | 6d41d472655673eb8facedb3ee7a7b5d3ed6914a /sw | |
parent | 9bc07cce52470f08872bba75411d88543c4cbd0f (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.
Change-Id: Ie275be53e30834cbb6576b8e7580c16d2e47bf16
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/pagedesc.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/doc/docdesc.cxx | 2 |
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 ) |