19990926-17:22 GMT+1

This commit is contained in:
Viktor Szakats
1999-09-26 15:35:20 +00:00
parent 4dac40f9e0
commit 0777bbc2dc
2 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,11 @@
19990926-17:22 GMT+1 Victor Szel <info@szelvesz.hu>
* source/rtl/asort.prg
! The block return type detection code now calls the block with
the nStart item, and not always the first one. This way it has less
side effect, since the block is not called with elements which would not
be accessed at all normally.
So this works now: aSort( { NIL, 20, 10 }, 2,, {|x,y| x < y } )
19990926-14:10 GMT+2 Ryszard Glab <rglab@imid.med.pl>
*source/compiler/harbour.y

View File

@@ -65,9 +65,12 @@ FUNCTION aSort( aArray, nStart, nCount, bBlock )
/* NOTE: For speed we are checking the return type of the passed
codeblock here. This will result in a small incompatibility
since the codeblock will be called one more time for the
first logical element than in Clipper. */
first logical element than in Clipper.
But this is block calling frequency and order differs from
Clipper anyway, since they use different sorting sorting
algorhythms. */
IF !ISBLOCK( bBlock ) .OR. !( ISLOG( Eval( bBlock, aArray[1], aArray[1] ) ) )
IF !ISBLOCK( bBlock ) .OR. !( ISLOG( Eval( bBlock, aArray[ nStart ], aArray[ nStart ] ) ) )
bBlock := {| x, y | x < y }
ENDIF