mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-16 03:57:03 +02:00
LazUtils: Restore test for HashTableSize>0, needed because HashTableSize is unsigned.
git-svn-id: trunk@48873 -
This commit is contained in:
parent
ded4b23a89
commit
414374dbd9
@ -80,18 +80,19 @@ var
|
||||
begin
|
||||
Result:=nil;
|
||||
continue:=True;
|
||||
for i:=0 to HashTableSize-1 do
|
||||
if Assigned(Chain(i)) then
|
||||
if chain(i).Count>0 then
|
||||
for j:=0 to Chain(i).Count-1 do
|
||||
begin
|
||||
aMethod(THTGNode(Chain(i)[j]).Data, THTGNode(Chain(i)[j]).Key, continue);
|
||||
if not continue then
|
||||
if HashTableSize>0 then
|
||||
for i:=0 to HashTableSize-1 do
|
||||
if Assigned(Chain(i)) then
|
||||
if chain(i).Count>0 then
|
||||
for j:=0 to Chain(i).Count-1 do
|
||||
begin
|
||||
Result:=THTGNode(Chain(i)[j]);
|
||||
Exit;
|
||||
aMethod(THTGNode(Chain(i)[j]).Data, THTGNode(Chain(i)[j]).Key, continue);
|
||||
if not continue then
|
||||
begin
|
||||
Result:=THTGNode(Chain(i)[j]);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TLazFPGHashTable.Iterate(aMethod: TGIteratorMethod): T;
|
||||
|
Loading…
Reference in New Issue
Block a user