From 2f7081b977842afe697b1bab71f6de5bf2d5e7e6 Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Mon, 8 Apr 2002 12:14:02 +0000 Subject: [PATCH] 2002-04-08 16:15 UTC+0300 Alexander Kresin --- harbour/ChangeLog | 4 ++++ harbour/source/rdd/dbfntx/dbfntx1.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7f89f80aca..d7b821f829 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,10 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ + use compiler cache, set HB_CCACHE environment variable. + (export HB_CCACHE=ccache) + +2002-04-10 13:22 UTC+0300 Alexander Kresin * source/rdd/dbfntx/dbfntx1.c ! Some fix for shared mode ( hb_ntxHeaderRead() function added ) diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index 594b5e59b6..5bb417929c 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -1869,8 +1869,13 @@ static void hb_ntxSortKeyEnd( LPTAGINFO pTag, LPNTXSORTINFO pSortInfo ) { if( pSortInfo->nItems ) { - pSortInfo->pKey1 = pSortInfo->pKey2; - hb_ntxKeysSort( pSortInfo, &(pSortInfo->pKeyFirst), pSortInfo->pKeyTemp, pTag->KeyLength, !pTag->AscendKey, pTag->UniqueKey ); + if( !pSortInfo->pKeyFirst ) + pSortInfo->pKeyFirst = pSortInfo->pKeyTemp; + else + { + pSortInfo->pKey1 = pSortInfo->pKey2; + hb_ntxKeysSort( pSortInfo, &(pSortInfo->pKeyFirst), pSortInfo->pKeyTemp, pTag->KeyLength, !pTag->AscendKey, pTag->UniqueKey ); + } pSortInfo->nItems = 0; } } @@ -2236,7 +2241,7 @@ static ERRCODE hb_ntxIndexCreate( LPNTXINDEX pIndex ) /* printf( "\nnParts=%d ulRecMax=%d",nParts,ulRecMax ); */ nParts = 1; } - sortInfo.ulSqrt = floor( sqrt( ( double) ulRecMax ) ); + sortInfo.ulSqrt = (ulRecMax>50)? floor( sqrt( ( double) ulRecMax ) ):ulRecMax; } else sortInfo.sortBuffer = NULL;