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:
@@ -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 ];
|
||||
|
||||
Reference in New Issue
Block a user