diff options
-rw-r--r-- | sw/source/core/bastyp/swcache.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx index 7f44352beab6..531ce2de4449 100644 --- a/sw/source/core/bastyp/swcache.cxx +++ b/sw/source/core/bastyp/swcache.cxx @@ -44,20 +44,19 @@ void SwCache::Check() SwCacheObj *const pOldRealFirst = m_pRealFirst; while ( pObj ) { - // the object must be found also when moving backwards - SwCacheObj *pTmp = m_pLast; - while ( pTmp && pTmp != pObj ) - pTmp = pTmp->GetPrev(); - assert(pTmp && "Object not found."); - ++nCnt; if ( pObj == m_pFirst ) bFirstFound = true; - if ( !pObj->GetNext() ) + SwCacheObj* pNext = pObj->GetNext(); + if ( !pNext ) { assert(pObj == m_pLast); } - pObj = pObj->GetNext(); + else + { + assert(pObj == pNext->GetPrev()); + } + pObj = pNext; assert(pObj != pOldRealFirst); (void) pOldRealFirst; } assert(bFirstFound); |