|
From: Micha N. <md...@us...> - 2004-08-24 08:56:50
|
Update of /cvsroot/tdbf/tdbf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18629 Modified Files: dbf_idxfile.pas history.txt Log Message: fixed: recursive loop in index first/last Index: history.txt =================================================================== RCS file: /cvsroot/tdbf/tdbf/history.txt,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** history.txt 23 Aug 2004 20:45:48 -0000 1.68 --- history.txt 24 Aug 2004 08:56:38 -0000 1.69 *************** *** 59,62 **** --- 59,64 ---- **Version .1: - fixed: recursive loop in setrange + **Version .2: + - fixed: recursive loop in index first/last Index: dbf_idxfile.pas =================================================================== RCS file: /cvsroot/tdbf/tdbf/dbf_idxfile.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dbf_idxfile.pas 23 Aug 2004 20:45:47 -0000 1.4 --- dbf_idxfile.pas 24 Aug 2004 08:56:38 -0000 1.5 *************** *** 287,290 **** --- 287,295 ---- procedure SetBracketHigh; + procedure WalkFirst; + procedure WalkLast; + function WalkPrev: boolean; + function WalkNext: boolean; + procedure TranslateToANSI(Src, Dest: PChar); function CompareKeyNumericNDX(Key: PChar): Integer; *************** *** 349,354 **** procedure First; procedure Last; - function WalkPrev: boolean; - function WalkNext: boolean; function Next: Boolean; function Prev: Boolean; --- 354,357 ---- *************** *** 3355,3362 **** end; ! procedure TIndexFile.First; begin - // resync tree - Resync(false); // search first node FRoot.RecurFirst; --- 3358,3363 ---- end; ! procedure TIndexFile.WalkFirst; begin // search first node FRoot.RecurFirst; *************** *** 3365,3372 **** end; ! procedure TIndexFile.Last; begin - // resync tree - Resync(false); // search last node FRoot.RecurLast; --- 3366,3371 ---- end; ! procedure TIndexFile.WalkLast; begin // search last node FRoot.RecurLast; *************** *** 3376,3379 **** --- 3375,3392 ---- end; + procedure TIndexFile.First; + begin + // resync tree + Resync(false); + WalkFirst; + end; + + procedure TIndexFile.Last; + begin + // resync tree + Resync(false); + WalkLast; + end; + procedure TIndexFile.ResyncRange; var *************** *** 3390,3394 **** begin // not found? -> make empty range ! Last; end; // set lower bound --- 3403,3407 ---- begin // not found? -> make empty range ! WalkLast; end; // set lower bound *************** *** 3404,3412 **** begin // cannot go prev -> empty range ! First; end; end else begin // not found -> EOF found, go EOF, then to last record ! Last; WalkPrev; end; --- 3417,3425 ---- begin // cannot go prev -> empty range ! WalkFirst; end; end else begin // not found -> EOF found, go EOF, then to last record ! WalkLast; WalkPrev; end; *************** *** 3432,3438 **** if FLeaf.Entry = FEntryBof then begin ! First; end else if FLeaf.Entry = FEntryEof then begin ! Last; end else begin // read current key into buffer --- 3445,3451 ---- if FLeaf.Entry = FEntryBof then begin ! WalkFirst; end else if FLeaf.Entry = FEntryEof then begin ! WalkLast; end else begin // read current key into buffer |