From e24fc7dfa3d1806fa22ecde2671d94d977f69621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E4=B8=80=E4=B8=80?= <1204244136@qq.com> Date: Wed, 7 May 2025 17:55:57 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=96=B0=E5=A2=9E=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E6=97=A5=E5=BF=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DoroHelper.ahk | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/DoroHelper.ahk b/DoroHelper.ahk index ca191d2..fcfd513 100644 --- a/DoroHelper.ahk +++ b/DoroHelper.ahk @@ -2346,7 +2346,7 @@ LoadSettings() { SaveSettings(*) { WriteSettings() MsgBox "设置已保存!" - AddLog("设置已保存!") + AddLog("设置已保存!", true) } ; 全局设置 Map 对象 global g_settings := Map( @@ -2534,15 +2534,14 @@ BtnClear.OnEvent("Click", (*) => LogBox.Value := "") if g_settings["Debug"] { DebugGui.Show() } -AddLog(text) { - ; global LogBox +AddLog(text, forceOutput := false) { ; 默认参数设为false if (!IsObject(LogBox) || !LogBox.Hwnd) { return } static lastText := "" ; 静态变量保存上一条内容 global LogBox - ; 如果内容与上一条相同则跳过 - if (text = lastText) + ; 如果内容与上一条相同且不强制输出,则跳过 + if (text = lastText && !forceOutput) return lastText := text ; 保存当前内容供下次比较 timestamp := FormatTime(, "HH:mm:ss")