codetools: keywordfunclists: use fast property Count

git-svn-id: branches/fixes_1_8@54641 -
This commit is contained in:
mattias 2017-04-19 11:02:29 +00:00
parent 1e655bcb16
commit 27937b0e13

View File

@ -85,7 +85,7 @@ type
procedure WriteDebugListing;
function AllwaysTrue: boolean;
function AllwaysFalse: boolean;
function Count: integer;
property Count: integer read FCount;
function GetItem(Index: integer): TBaseKeyWordFunctionListItem;
function IndexOf(const AKeyWord: shortstring): integer;
function CalcMemSize: PtrUInt;
@ -504,11 +504,6 @@ begin
Result:=false;
end;
function TBaseKeyWordFunctionList.Count: integer;
begin
Result:=FCount;
end;
function TBaseKeyWordFunctionList.GetItem(Index: integer
): TBaseKeyWordFunctionListItem;
begin
@ -517,6 +512,8 @@ end;
function TBaseKeyWordFunctionList.IndexOf(const AKeyWord: shortstring): integer;
begin
if not Sorted then Sort;
Result:=FCount-1;
while (Result>=0) and (CompareText(FItems[Result].KeyWord,AKeyWord)<>0) do
dec(Result);