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

View File

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

View File

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