From dbe4ef82381f731aef62bdb63c33da260d52e28c Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Sat, 28 Jul 2018 18:37:26 +0200 Subject: [PATCH] better fix for profiling prints WowAce issue 1155 --- WeakAuras/WeakAuras.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index d4b4b948fb..5b1d993223 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -4742,10 +4742,10 @@ function WeakAuras.StartProfile() if (profileData.systems.time and profileData.systems.time.count == 1) then prettyPrint(L["Profiling already started."]); return; - else - prettyPrint(L["Profiling started."]) end + prettyPrint(L["Profiling started."]) + profileData.systems = {}; profileData.auras = {}; profileData.systems.time = {}; @@ -4762,16 +4762,13 @@ local function doNothing() end function WeakAuras.StopProfile() - if (not profileData.systems.time or not profileData.systems.time.count == 1) then + if (not profileData.systems.time or profileData.systems.time.count ~= 1) then prettyPrint(L["Profiling not running."]); return; - elseif (profileData.systems.time.count == 1) then - profileData.systems.time.count = 0; - prettyPrint(L["Profiling stopped."]) - else - prettyPrint(L["Profiling not running."]); end + prettyPrint(L["Profiling stopped."]) + profileData.systems.time.elapsed = debugprofilestop() - profileData.systems.time.start; profileData.systems.time.count = 0;