* Merging revisions r43038 from trunk:

------------------------------------------------------------------------
    r43038 | michael | 2019-09-19 10:39:35 +0200 (Thu, 19 Sep 2019) | 1 line
    
    Call CurrentIndexBuf only once
    ------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@43763 -
This commit is contained in:
michael 2019-12-23 14:20:21 +00:00
parent 40d9899d65
commit a00ee7af19

View File

@ -2173,7 +2173,12 @@ begin
FD:=InternalAddIndex(SDefaultIndex,'',[],'','');
FD.IndexType:=itDefault;
FD.FDiscardOnClose:=True;
end;
end
// Not sure about this. For the moment we leave it in comment
{ else if FD.BufferIndex=Nil then
InternalCreateIndex(FD)}
;
FCurrentIndexDef:=FD;
// Custom index
if not IsUniDirectional then
@ -2184,7 +2189,11 @@ begin
FC:=InternalAddIndex(SCustomIndex,'',[],'','');
FC.IndexType:=itCustom;
FC.FDiscardOnClose:=True;
end;
end
// Not sure about this. For the moment we leave it in comment
{ else if FD.BufferIndex=Nil then
InternalCreateIndex(FD)}
;
end;
BookmarkSize:=CurrentIndexBuf.BookmarkSize;
end;
@ -2405,6 +2414,7 @@ function TCustomBufDataset.getnextpacket : integer;
var i : integer;
pb : TRecordBuffer;
T : TBufIndex;
begin
if FAllPacketsFetched then
@ -2412,8 +2422,8 @@ begin
result := 0;
exit;
end;
CurrentIndexBuf.BeginUpdate;
T:=CurrentIndexBuf;
T.BeginUpdate;
i := 0;
pb := DefaultBufferIndex.SpareBuffer;
@ -2427,7 +2437,7 @@ begin
inc(i);
end;
CurrentIndexBuf.EndUpdate;
T.EndUpdate;
FBRecordCount := FBRecordCount + i;
result := i;
end;