[Libreoffice-commits] core.git: sw/source
Michael Stahl
mstahl at redhat.com
Mon Jan 29 19:05:43 UTC 2018
sw/source/core/txtnode/ndhints.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 61535f9b8a58f93e5f856284a007f96f4a905621
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Jan 29 20:01:25 2018 +0100
sw: speed up SwpHints::Check() by 2x
It's only necessary to compare each pair of nesting hints once.
Change-Id: I221bb0d63ffaf3d748b934788f93afe0f65ed961
diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx
index fb360de42e62..5b5ebc7b123a 100644
--- a/sw/source/core/txtnode/ndhints.cxx
+++ b/sw/source/core/txtnode/ndhints.cxx
@@ -328,10 +328,10 @@ bool SwpHints::Check(bool bPortionsMerged) const
// 9) nesting portion check
if (pHtThis->IsNesting())
{
- for ( size_t j = 0; j < Count(); ++j )
+ for (size_t j = 0; j < i; ++j)
{
SwTextAttr const * const pOther( m_HintsByStart[j] );
- if ( pOther->IsNesting() && (i != j) )
+ if (pOther->IsNesting())
{
SwComparePosition cmp = ComparePosition(
pHtThis->GetStart(), *pHtThis->End(),
More information about the Libreoffice-commits
mailing list