From 84b843bbce11da611729975a17d667d7687e4327 Mon Sep 17 00:00:00 2001 From: Sun Serega Date: Fri, 12 Jan 2024 23:16:52 +0200 Subject: [PATCH] don't compile modules twice --- PackAll.pas | 15 +++++++++------ Utils/Timers.pas | 13 ++++++++++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/PackAll.pas b/PackAll.pas index d84fe353..03e799ef 100644 --- a/PackAll.pas +++ b/PackAll.pas @@ -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; diff --git a/Utils/Timers.pas b/Utils/Timers.pas index 02e519fd..246edd18 100644 --- a/Utils/Timers.pas +++ b/Utils/Timers.pas @@ -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 cp.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;