From f5d20636130f895c9d2510af95936538a7484a0c Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 31 Aug 2019 13:20:10 +0300 Subject: [PATCH] - do thinker profiling of internal dynlights only when they are present There is no point to output zero calls and/or handle such case in profiling stats calculation --- src/playsim/dthinker.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/playsim/dthinker.cpp b/src/playsim/dthinker.cpp index 7b286ebec9..8ef9659e59 100644 --- a/src/playsim/dthinker.cpp +++ b/src/playsim/dthinker.cpp @@ -150,17 +150,20 @@ void FThinkerCollection::RunThinkers(FLevelLocals *Level) } } while (count != 0); - // Also profile the internal dynamic lights, even though they are not implemented as thinkers. - auto &prof = Profiles[NAME_InternalDynamicLight]; - prof.timer.Clock(); - for (auto light = Level->lights; light;) + if (Level->lights) { - prof.numcalls++; - auto next = light->next; - light->Tick(); - light = next; + // Also profile the internal dynamic lights, even though they are not implemented as thinkers. + auto &prof = Profiles[NAME_InternalDynamicLight]; + prof.timer.Clock(); + for (auto light = Level->lights; light;) + { + prof.numcalls++; + auto next = light->next; + light->Tick(); + light = next; + } + prof.timer.Unclock(); } - prof.timer.Unclock(); struct SortedProfileInfo