mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 23:19:24 +02:00
Call CurrentIndexBuf only once
git-svn-id: trunk@43038 -
This commit is contained in:
parent
9396decb19
commit
3dba0fe5b2
@ -2168,7 +2168,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
|
||||
@ -2179,7 +2184,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;
|
||||
@ -2379,6 +2388,7 @@ function TCustomBufDataset.getnextpacket : integer;
|
||||
|
||||
var i : integer;
|
||||
pb : TRecordBuffer;
|
||||
T : TBufIndex;
|
||||
|
||||
begin
|
||||
if FAllPacketsFetched then
|
||||
@ -2386,8 +2396,8 @@ begin
|
||||
result := 0;
|
||||
exit;
|
||||
end;
|
||||
|
||||
CurrentIndexBuf.BeginUpdate;
|
||||
T:=CurrentIndexBuf;
|
||||
T.BeginUpdate;
|
||||
|
||||
i := 0;
|
||||
pb := DefaultBufferIndex.SpareBuffer;
|
||||
@ -2401,7 +2411,7 @@ begin
|
||||
inc(i);
|
||||
end;
|
||||
|
||||
CurrentIndexBuf.EndUpdate;
|
||||
T.EndUpdate;
|
||||
FBRecordCount := FBRecordCount + i;
|
||||
result := i;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user