Skip to content

Commit

Permalink
don't compile modules twice
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Jan 12, 2024
1 parent 0f6f93b commit 84b843b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
15 changes: 9 additions & 6 deletions PackAll.pas
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,19 @@
if mn in CurrentStages then Result += EventTask(ModulePackingStage.GetModulePackEv(mn));
if mn+'ABC' in CurrentStages then Result += EventTask(ModulePackingStage.GetModulePackEv(mn+'ABC'));

if IsPackingAllModules then
begin
if FileExists($'Modules/{mn}ABC.pas') then
Result += CompTask($'Modules.Packed/{mn}ABC.pas') else
Result += CompTask($'Modules.Packed/{mn}.pas');
exit;
end;

if mn+'ABC' in CurrentStages then
Result += CompTask($'Modules.Packed/{mn}ABC.pas') else
if mn in CurrentStages then
Result += CompTask($'Modules.Packed/{mn}.pas') else
if not IsPackingAllModules then
exit;

if FileExists($'Modules/{mn}ABC.pas') then
Result += CompTask($'Modules.Packed/{mn}ABC.pas') else
Result += CompTask($'Modules.Packed/{mn}.pas');
;

end;

Expand Down
13 changes: 10 additions & 3 deletions Utils/Timers.pas
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,24 @@ interface
//TODO #2896
yield (lvl+1, $'♦ {nick} x{l.Count}', Timer.TimeToText(time_per_nick[nick]));

var common_name_parts := l.First[0].Split('/');
var common_name_parts := l.First[0].Split('/')[:^1];
foreach var (full_name, t) in l.Skip(1) do
begin
var c := common_name_parts.ZipTuple(full_name.Split('/')).TakeWhile(\(p1,p2)->p1=p2).Count;
var c := common_name_parts.ZipTuple(full_name.Split('/')[:^1]).TakeWhile(\(p1,p2)->p1=p2).Count;
if c<common_name_parts.Length then
common_name_parts := common_name_parts[:c];
end;
var common_skip_len := common_name_parts.Sum(p->p.Length+1);

foreach var (full_name, t) in l.OrderBy(t->t[0]) do
yield sequence t.MakeLogLines(lvl+2, full_name.SubString(common_skip_len));
begin
if full_name.Length<=common_skip_len then
begin
Otp($'ERROR: [{full_name}] does not have {common_skip_len} chars');
continue;
end;
yield sequence t.MakeLogLines(lvl+2, full_name.Substring(common_skip_len));
end;

end;

Expand Down

0 comments on commit 84b843b

Please sign in to comment.