mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:39:31 +02:00
LCL: replaced linear search for resources
git-svn-id: trunk@18637 -
This commit is contained in:
parent
2233cd9d24
commit
aea991aebd
@ -1451,21 +1451,22 @@ begin
|
||||
for I := P - 1 downto 0 do
|
||||
begin
|
||||
Result := TLResource(FList[I]);
|
||||
// ToDo
|
||||
if (Result.Name = Name) and (Result.ValueType = ValueType) then
|
||||
if AnsiCompareText(Result.Name,Name)<>0 then
|
||||
break;
|
||||
if Result.ValueType = ValueType then
|
||||
Exit;
|
||||
end;
|
||||
// look from position
|
||||
// look behind position
|
||||
for I := P to FList.Count - 1 do
|
||||
begin
|
||||
Result := TLResource(FList[I]);
|
||||
if (Result.Name = Name) and (Result.ValueType = ValueType) then
|
||||
if AnsiCompareText(Result.Name,Name)<>0 then
|
||||
break;
|
||||
if Result.ValueType = ValueType then
|
||||
Exit;
|
||||
end;
|
||||
Result := nil;
|
||||
end
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function TLResourceList.FindPosition(const Name: AnsiString): Integer;
|
||||
|
Loading…
Reference in New Issue
Block a user