2003-01-30 22:10 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2003-01-30 22:10 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
* source/vm/asort.c
|
||||
! Some fixes, which became necessary after optimization of string operations.
|
||||
|
||||
2003-01-29 22:05 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
* include/hberrors.h
|
||||
* include/hbpcode.h
|
||||
|
||||
@@ -117,8 +117,14 @@ static LONG hb_arraySortQuickPartition( PHB_ITEM pItems, LONG lb, LONG ub, PHB_I
|
||||
|
||||
#ifdef HB_ASORT_OPT_ITEMCOPY
|
||||
memcpy( &pivot, pItems + p, sizeof( HB_ITEM ) );
|
||||
if( HB_IS_STRING( &pivot ) && (&pivot)->item.asString.bStatic < 0 )
|
||||
(&pivot)->item.asString.value = (&pivot)->item.asString.u.value;
|
||||
if( p != lb )
|
||||
{
|
||||
memcpy( pItems + p, pItems + lb, sizeof( HB_ITEM ) );
|
||||
if( HB_IS_STRING( pItems + p ) && (pItems + p)->item.asString.bStatic < 0 )
|
||||
(pItems + p)->item.asString.value = (pItems + p)->item.asString.u.value;
|
||||
}
|
||||
#else
|
||||
hb_itemInit( &pivot );
|
||||
hb_itemCopy( &pivot, pItems + p );
|
||||
@@ -184,6 +190,10 @@ static LONG hb_arraySortQuickPartition( PHB_ITEM pItems, LONG lb, LONG ub, PHB_I
|
||||
memcpy( &temp, pItems + j, sizeof( HB_ITEM ) );
|
||||
memcpy( pItems + j, pItems + i, sizeof( HB_ITEM ) );
|
||||
memcpy( pItems + i, &temp, sizeof( HB_ITEM ) );
|
||||
if( HB_IS_STRING( pItems + i ) && (pItems + i)->item.asString.bStatic < 0 )
|
||||
(pItems + i)->item.asString.value = (pItems + i)->item.asString.u.value;
|
||||
if( HB_IS_STRING( pItems + j ) && (pItems + j)->item.asString.bStatic < 0 )
|
||||
(pItems + j)->item.asString.value = (pItems + j)->item.asString.u.value;
|
||||
#else
|
||||
hb_itemInit( &temp );
|
||||
hb_itemCopy( &temp, pItems + j );
|
||||
@@ -200,8 +210,14 @@ static LONG hb_arraySortQuickPartition( PHB_ITEM pItems, LONG lb, LONG ub, PHB_I
|
||||
/* pivot belongs in pItems[j] */
|
||||
#ifdef HB_ASORT_OPT_ITEMCOPY
|
||||
if( lb != j )
|
||||
{
|
||||
memcpy( pItems + lb, pItems + j, sizeof( HB_ITEM ) );
|
||||
if( HB_IS_STRING( pItems + lb ) && (pItems + lb)->item.asString.bStatic < 0 )
|
||||
(pItems + lb)->item.asString.value = (pItems + lb)->item.asString.u.value;
|
||||
}
|
||||
memcpy( pItems + j, &pivot, sizeof( HB_ITEM ) );
|
||||
if( HB_IS_STRING( pItems + j ) && (pItems + j)->item.asString.bStatic < 0 )
|
||||
(pItems + j)->item.asString.value = (pItems + j)->item.asString.u.value;
|
||||
#else
|
||||
if( lb != j )
|
||||
hb_itemCopy( pItems + lb, pItems + j );
|
||||
|
||||
Reference in New Issue
Block a user