IDE: Simplify TUnitInfo.NeedsSaveToDisk and don't check LFM if the unit is an LFM file itself.

This commit is contained in:
Juha 2023-07-22 14:57:58 +03:00
parent 138b8f2eae
commit c539d373e7

View File

@ -2243,11 +2243,9 @@ end;
function TUnitInfo.NeedsSaveToDisk(CheckLFM: boolean): boolean; function TUnitInfo.NeedsSaveToDisk(CheckLFM: boolean): boolean;
begin begin
Result:=IsVirtual or Modified or IsChangedOnDisk(CheckLFM); // Modified has a test for Source.ChangeStep<>fSourceChangeStep.
//DebugLn(['TUnitInfo.NeedsSaveToDisk ',filename,' Result=',Result,' Modified=',Modified]); Result:=IsVirtual or Modified or IsChangedOnDisk(CheckLFM and FilenameIsPascalSource(Filename));
if Result then Exit; //DebugLn(['TUnitInfo.NeedsSaveToDisk ',Filename,' Result=',Result,' Modified=',Modified]);
if Source<>nil then
Result:=Source.ChangeStep<>fSourceChangeStep;
end; end;
procedure TUnitInfo.UpdateUsageCount(Min, IfBelowThis, IncIfBelow: extended); procedure TUnitInfo.UpdateUsageCount(Min, IfBelowThis, IncIfBelow: extended);