From 9a8dce2b4e009d8b98c87197e3f8cc6a5c3afbd1 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 27 May 2010 13:30:02 +0000 Subject: [PATCH] codetools: accelerated TCodeCache.SaveIncludeLinksDataToList git-svn-id: trunk@25689 - --- components/codetools/codecache.pas | 46 ++++++++++++++++-------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/components/codetools/codecache.pas b/components/codetools/codecache.pas index 2c54353c64..39d3836657 100644 --- a/components/codetools/codecache.pas +++ b/components/codetools/codecache.pas @@ -525,35 +525,28 @@ var LastLine: String; CurrDate: TDateTime; ExpirationTime: TDateTime; + Node: TAVLTreeNode; procedure AddLine(Line: string); var - p: Integer; + p1: PChar; + p2: PChar; + p: PtrUint; begin - p:=1; - while (p<=length(Line)) and (p<=length(LastLine)) - and (Line[p]=LastLine[p]) do - inc(p); + p1:=PChar(Line); + p2:=PChar(LastLine); + while (p1^=p2^) and (p1^<>#0) do begin + inc(p1); + inc(p2); + end; + p:=p1-PChar(Line); List.Add(IntToStr(p-1)+':'+copy(Line,p,length(Line))); LastLine:=Line; end; - procedure SaveLinkTree(ANode: TAVLTreeNode); - var - ALink: TIncludedByLink; - DiffTime: TDateTime; - begin - if ANode=nil then exit; - SaveLinkTree(ANode.Left); - ALink:=TIncludedByLink(ANode.Data); - DiffTime:=CurrDate-ALink.LastTimeUsed; - if (FExpirationTimeInDays<=0) or (DiffTimenil do begin + ALink:=TIncludedByLink(Node.Data); + DiffTime:=CurrDate-ALink.LastTimeUsed; + if (FExpirationTimeInDays<=0) or (DiffTime