mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-08 19:42:34 +02:00
* Patch from Luiz Americo to fix bug #12330: TLookupList returns wrong value
when key is not found git-svn-id: trunk@12771 -
This commit is contained in:
parent
df7a6b0f5d
commit
7e4f521361
@ -2363,9 +2363,9 @@ begin
|
||||
if VarIsNull(AKey) then Exit;
|
||||
i := FList.Count - 1;
|
||||
if VarIsArray(AKey) then
|
||||
while (i > 0) And not VarArraySameValues(PLookupListRec(FList.Items[I])^.Key,AKey) do Dec(i)
|
||||
while (i >= 0) And not VarArraySameValues(PLookupListRec(FList.Items[I])^.Key,AKey) do Dec(i)
|
||||
else
|
||||
while (i > 0) And (PLookupListRec(FList.Items[I])^.Key <> AKey) do Dec(i);
|
||||
while (i >= 0) And (PLookupListRec(FList.Items[I])^.Key <> AKey) do Dec(i);
|
||||
if i >= 0 then Result := PLookupListRec(FList.Items[I])^.Value;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user