File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7044,14 +7044,17 @@ function TSymbolTable.FindTypeSymbol(
70447044//
70457045function TSymbolTable.EnumerateLocalSymbolsOfName (
70467046 const aName : String; const callback : TSymbolEnumerationCallback) : Boolean;
7047- var
7048- i : Integer;
7049- sym : TSymbol;
70507047begin
70517048 // TODO: optimize to take advantage of sorting
7052- for i:=0 to Count-1 do begin
7053- sym:=Symbols[i];
7054- if UnicodeSameText(sym.Name , aName) then begin
7049+ var list := FSymbols.List;
7050+ var nameLen := Length(aName);
7051+ for var i := 0 to Count-1 do begin
7052+ var sym := TSymbol(list[i]);
7053+ if (Length(sym.Name ) = nameLen)
7054+ and (
7055+ (nameLen = 0 )
7056+ or (UnicodeCompareLen(Pointer(sym.Name ), Pointer(aName), nameLen) = 0 )
7057+ ) then begin
70557058 if callback(sym) then Exit(True);
70567059 end ;
70577060 end ;
You can’t perform that action at this time.
0 commit comments