[Libreoffice-commits] core.git: ucb/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 20 08:58:53 UTC 2020


 ucb/source/sorter/sortresult.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 4bceda79065e91d6410d05931bff0324a9cbc321
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Jan 20 08:42:44 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Jan 20 09:58:20 2020 +0100

    Split independent loop vars, giving them appropriate types
    
    ...and thus avoiding an unnecessary explicit cast from sal_IntPtr to
    (potentially smaller) sal_uInt32
    
    Change-Id: Id05769c1db1cd272c8c193361c8f39f01dbec948
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87050
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index 8d8334cff393..1a6c65619a1c 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -1377,7 +1377,6 @@ void SortedResultSet::InsertNew( sal_IntPtr nPos, sal_IntPtr nCount )
 
 void SortedResultSet::Remove( sal_IntPtr nPos, sal_IntPtr nCount, EventList *pEvents )
 {
-    sal_uInt32  i;
     sal_IntPtr        nOldLastSort;
 
     // correct mnLastSort first
@@ -1392,7 +1391,7 @@ void SortedResultSet::Remove( sal_IntPtr nPos, sal_IntPtr nCount, EventList *pEv
 
     // remove the entries from the lists and correct the positions
     // in the original2sorted list
-    for ( i=0; i < static_cast<sal_uInt32>(nCount); i++ )
+    for ( sal_IntPtr i=0; i < nCount; i++ )
     {
         sal_IntPtr nSortPos = m_O2S[nPos];
         m_O2S.erase(m_O2S.begin() + nPos);
@@ -1417,7 +1416,7 @@ void SortedResultSet::Remove( sal_IntPtr nPos, sal_IntPtr nCount, EventList *pEv
     }
 
     // correct the positions in the sorted list
-    for ( i=1; i<= maS2O.Count(); i++ )
+    for ( sal_uInt32 i=1; i<= maS2O.Count(); i++ )
     {
         SortListData *pData = maS2O.GetData( i );
         if ( pData->mnCurPos > nPos )


More information about the Libreoffice-commits mailing list