Kaydet (Commit) 6ca90a0f authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Zolnai Tamás

Optimize a bit GraphicCache::GetUniqueID

Don't call twice ImplGetCacheEntry when TryToSwapIn hasn't been called

Change-Id: I0a808801c94c8179a4f5d863648907b4102f6564
Reviewed-on: https://gerrit.libreoffice.org/16958Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarZolnai Tamás <zolnaitamas2000@gmail.com>
üst ee35b720
...@@ -1074,10 +1074,11 @@ OString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const ...@@ -1074,10 +1074,11 @@ OString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const
// ensure that the entry is correctly initialized (it has to be read at least once) // ensure that the entry is correctly initialized (it has to be read at least once)
if( pEntry && pEntry->GetID().IsEmpty() ) if( pEntry && pEntry->GetID().IsEmpty() )
{
pEntry->TryToSwapIn(); pEntry->TryToSwapIn();
// do another call to ImplGetCacheEntry in case of modified entry list
// do another call to ImplGetCacheEntry in case of modified entry list pEntry = const_cast<GraphicCache*>(this)->ImplGetCacheEntry( rObj );
pEntry = const_cast<GraphicCache*>(this)->ImplGetCacheEntry( rObj ); }
if( pEntry ) if( pEntry )
aRet = pEntry->GetID().GetIDString(); aRet = pEntry->GetID().GetIDString();
......
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