aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-01-20 11:15:55 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-01-20 11:26:53 +0100
commit072d34947321fff4afa4e7df059874c3523eaccd (patch)
treeefe69b59d2ffb3edee640485dad3dec108a15194
parent2294ac77a8a69b1962e06264ae0f4c250e5365ff (diff)
log-forward: cache the result of $LogForwardFilterLogForwarding
Looks like the function is called for every message to match otherwise. 😳
-rw-r--r--log-forward3
1 files changed, 2 insertions, 1 deletions
diff --git a/log-forward b/log-forward
index 73620e8..96cb257 100644
--- a/log-forward
+++ b/log-forward
@@ -47,8 +47,9 @@ $ScriptLock $0;
:local MessageVal;
:local MessageDups ({});
+:local LogForwardFilterLogForwardingCached [ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ];
:foreach Message in=[ /log/find where (!(message="") and \
- !(message~[ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ]) and \
+ !(message~$LogForwardFilterLogForwardingCached) and \
!(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \
topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={
:set MessageVal [ /log/get $Message ];