mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-23 13:59:24 +01:00
MG: fixed unique code lists
git-svn-id: trunk@3519 -
This commit is contained in:
parent
85b9ae6942
commit
6543bb78ea
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user