mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 23:40:40 +02:00
codetools: keywordfunclists: use fast property Count
git-svn-id: branches/fixes_1_8@54641 -
This commit is contained in:
parent
1e655bcb16
commit
27937b0e13
@ -85,7 +85,7 @@ type
|
|||||||
procedure WriteDebugListing;
|
procedure WriteDebugListing;
|
||||||
function AllwaysTrue: boolean;
|
function AllwaysTrue: boolean;
|
||||||
function AllwaysFalse: boolean;
|
function AllwaysFalse: boolean;
|
||||||
function Count: integer;
|
property Count: integer read FCount;
|
||||||
function GetItem(Index: integer): TBaseKeyWordFunctionListItem;
|
function GetItem(Index: integer): TBaseKeyWordFunctionListItem;
|
||||||
function IndexOf(const AKeyWord: shortstring): integer;
|
function IndexOf(const AKeyWord: shortstring): integer;
|
||||||
function CalcMemSize: PtrUInt;
|
function CalcMemSize: PtrUInt;
|
||||||
@ -504,11 +504,6 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBaseKeyWordFunctionList.Count: integer;
|
|
||||||
begin
|
|
||||||
Result:=FCount;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TBaseKeyWordFunctionList.GetItem(Index: integer
|
function TBaseKeyWordFunctionList.GetItem(Index: integer
|
||||||
): TBaseKeyWordFunctionListItem;
|
): TBaseKeyWordFunctionListItem;
|
||||||
begin
|
begin
|
||||||
@ -517,6 +512,8 @@ end;
|
|||||||
|
|
||||||
function TBaseKeyWordFunctionList.IndexOf(const AKeyWord: shortstring): integer;
|
function TBaseKeyWordFunctionList.IndexOf(const AKeyWord: shortstring): integer;
|
||||||
begin
|
begin
|
||||||
|
if not Sorted then Sort;
|
||||||
|
|
||||||
Result:=FCount-1;
|
Result:=FCount-1;
|
||||||
while (Result>=0) and (CompareText(FItems[Result].KeyWord,AKeyWord)<>0) do
|
while (Result>=0) and (CompareText(FItems[Result].KeyWord,AKeyWord)<>0) do
|
||||||
dec(Result);
|
dec(Result);
|
||||||
|
Loading…
Reference in New Issue
Block a user