2015-07-31 17:12 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/vm/asort.c
    ! fixed missing nStart checking during array items reordering

  * utils/hbtest/rt_array.prg
    * updated Harbour specific results - I thought that someone
      invested time to exactly replicate CA-Cl*pper ASort() sorting
      but in fact Harbour specific resutls where hardcoded inside
      HBTEST so previous code was not Cl*pper compatible in the
      same way as current one.
This commit is contained in:
Przemysław Czerpak
2015-07-31 17:12:25 +02:00
parent 964e9a6695
commit 748cf7e81f
3 changed files with 27 additions and 16 deletions

View File

@@ -309,9 +309,9 @@ static void hb_arraySortStart( PHB_BASEARRAY pBaseArray, PHB_ITEM pBlock,
for( nPos = 0; nPos < nCount; ++nPos )
{
if( nPos != pDest[ nPos ] )
if( nPos + nStart != pDest[ nPos ] )
{
hb_itemSwap( pBaseArray->pItems + nPos,
hb_itemSwap( pBaseArray->pItems + nPos + nStart,
pBaseArray->pItems + pDest[ nPos ] );
pDest[ pPos[ nPos ] ] = pDest[ nPos ];
pPos[ pDest[ nPos ] - nStart ] = pPos[ nPos ];