mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 22:49:23 +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:=InternalAddIndex(SDefaultIndex,'',[],'','');
|
||||||
FD.IndexType:=itDefault;
|
FD.IndexType:=itDefault;
|
||||||
FD.FDiscardOnClose:=True;
|
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;
|
FCurrentIndexDef:=FD;
|
||||||
// Custom index
|
// Custom index
|
||||||
if not IsUniDirectional then
|
if not IsUniDirectional then
|
||||||
@ -2179,7 +2184,11 @@ begin
|
|||||||
FC:=InternalAddIndex(SCustomIndex,'',[],'','');
|
FC:=InternalAddIndex(SCustomIndex,'',[],'','');
|
||||||
FC.IndexType:=itCustom;
|
FC.IndexType:=itCustom;
|
||||||
FC.FDiscardOnClose:=True;
|
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;
|
end;
|
||||||
BookmarkSize:=CurrentIndexBuf.BookmarkSize;
|
BookmarkSize:=CurrentIndexBuf.BookmarkSize;
|
||||||
end;
|
end;
|
||||||
@ -2379,6 +2388,7 @@ function TCustomBufDataset.getnextpacket : integer;
|
|||||||
|
|
||||||
var i : integer;
|
var i : integer;
|
||||||
pb : TRecordBuffer;
|
pb : TRecordBuffer;
|
||||||
|
T : TBufIndex;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if FAllPacketsFetched then
|
if FAllPacketsFetched then
|
||||||
@ -2386,8 +2396,8 @@ begin
|
|||||||
result := 0;
|
result := 0;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
T:=CurrentIndexBuf;
|
||||||
CurrentIndexBuf.BeginUpdate;
|
T.BeginUpdate;
|
||||||
|
|
||||||
i := 0;
|
i := 0;
|
||||||
pb := DefaultBufferIndex.SpareBuffer;
|
pb := DefaultBufferIndex.SpareBuffer;
|
||||||
@ -2401,7 +2411,7 @@ begin
|
|||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
CurrentIndexBuf.EndUpdate;
|
T.EndUpdate;
|
||||||
FBRecordCount := FBRecordCount + i;
|
FBRecordCount := FBRecordCount + i;
|
||||||
result := i;
|
result := i;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user