MG: fixed unique code lists

git-svn-id: trunk@3519 -
This commit is contained in:
lazarus 2002-10-18 06:47:20 +00:00
parent 85b9ae6942
commit 6543bb78ea
3 changed files with 9 additions and 9 deletions

View File

@ -434,9 +434,9 @@ begin
m:=0; m:=0;
while r>=l do begin while r>=l do begin
m:=(l+r) shr 1; m:=(l+r) shr 1;
if UniqueSortedCodeList[m]<ACode then if ACode<UniqueSortedCodeList[m] then
r:=m-1 r:=m-1
else if UniqueSortedCodeList[m]>ACode then else if ACode>UniqueSortedCodeList[m] then
l:=m+1 l:=m+1
else begin else begin
Result:=m; Result:=m;
@ -454,14 +454,14 @@ begin
m:=0; m:=0;
while r>=l do begin while r>=l do begin
m:=(l+r) shr 1; m:=(l+r) shr 1;
if UniqueSortedCodeList[m]<ACode then if ACode<UniqueSortedCodeList[m] then
r:=m-1 r:=m-1
else if UniqueSortedCodeList[m]>ACode then else if ACode>UniqueSortedCodeList[m] then
l:=m+1 l:=m+1
else else
exit; exit;
end; end;
if (m<UniqueSortedCodeList.Count) and (UniqueSortedCodeList[m]<ACode) then if (m<UniqueSortedCodeList.Count) and (ACode>UniqueSortedCodeList[m]) then
inc(m); inc(m);
UniqueSortedCodeList.Insert(m,ACode); UniqueSortedCodeList.Insert(m,ACode);
end; end;

View File

@ -776,7 +776,7 @@ end;
function TSourceChangeCache.BufferIsModified(ACode: TCodeBuffer): boolean; function TSourceChangeCache.BufferIsModified(ACode: TCodeBuffer): boolean;
begin begin
UpdateBuffersToModify; UpdateBuffersToModify;
Result:=FBuffersToModify.IndexOf(ACode)>=0; Result:=IndexOfCodeInUniqueList(ACode,FBuffersToModify)>=0;
end; end;
procedure TSourceChangeCache.UpdateBuffersToModify; procedure TSourceChangeCache.UpdateBuffersToModify;

View File

@ -1130,9 +1130,9 @@ function TStandardCodeTool.ReplaceIdentifiers(IdentList: TStrings;
begin begin
// identifier found -> replace // identifier found -> replace
IdentEnd:=IdentStart+length(IdentList[i]); IdentEnd:=IdentStart+length(IdentList[i]);
writeln('TStandardCodeTool.ReplaceIdentifiers replacing: ', //writeln('TStandardCodeTool.ReplaceIdentifiers replacing: ',
' "',copy(CurSource,IdentStart,IdentEnd-IdentStart),'" -> "',IdentList[i+1],'" at ',IdentStart //' "',copy(CurSource,IdentStart,IdentEnd-IdentStart),'" -> "',IdentList[i+1],'" at ',IdentStart
); //);
SourceChangeCache.ReplaceEx(gtNone,gtNone,1,1, SourceChangeCache.ReplaceEx(gtNone,gtNone,1,1,
ACode,IdentStart,IdentEnd,IdentList[i+1]); ACode,IdentStart,IdentEnd,IdentList[i+1]);
break; break;