Kaydet (Commit) 78378af1 authored tarafından Michael Meeks's avatar Michael Meeks

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
üst 9bc07cce
......@@ -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; }
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment