From 9a89cd54077dbb77c1130396d6218ec8fa735594 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:32:44 +0200 Subject: global-functions: update initialization of empty array Having the parenthesis here is important for valid syntax! --- global-functions | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/global-functions b/global-functions index 94f3763..8ef158a 100644 --- a/global-functions +++ b/global-functions @@ -585,7 +585,7 @@ # prepare NotificationFunctions array :if ([ :typeof $NotificationFunctions ] != "array") do={ - :set NotificationFunctions [ :toarray "" ]; + :set NotificationFunctions ({}); } # send notification via e-mail - expects one array argument @@ -612,7 +612,7 @@ } :if ([ :typeof $EmailQueue ] = "nothing") do={ - :set EmailQueue [ :toarray "" ]; + :set EmailQueue ({}); } :local Signature [ /system/note/get note ]; :set ($EmailQueue->[ :len $EmailQueue ]) { @@ -634,7 +634,7 @@ :if ([ :typeof $Source ] != "array") do={ :set Source [ :tostr $1 ]; } - :local Result [ :toarray "" ]; + :local Result ({}); :foreach KeyValue in=[ :toarray $Source ] do={ :if ([ :find $KeyValue "=" ]) do={ :set ($Result->[ :pick $KeyValue 0 [ :find $KeyValue "=" ] ]) \ @@ -974,10 +974,10 @@ :global ScriptLockOrder; :if ([ :typeof $ScriptLockOrder ] = "nothing") do={ - :set ScriptLockOrder [ :toarray "" ]; + :set ScriptLockOrder ({}); } :if ([ :typeof ($ScriptLockOrder->$Script) ] = "nothing") do={ - :set ($ScriptLockOrder->$Script) [ :toarray "" ]; + :set ($ScriptLockOrder->$Script) ({}); } :local JobCount do={ @@ -1052,7 +1052,7 @@ } } - :set ($ScriptLockOrder->$Script) [ :toarray "" ]; + :set ($ScriptLockOrder->$Script) ({}); } :if ([ :len [ /system/script/find where name=$Script ] ] = 0) do={ @@ -1065,7 +1065,7 @@ :if ([ $TicketCount $Script ] >= [ $JobCount $Script ]) do={ $LogPrintExit2 error $0 ("More tickets than running scripts '" . $Script . "', resetting!") false; - :set ($ScriptLockOrder->$Script) [ :toarray "" ]; + :set ($ScriptLockOrder->$Script) ({}); /system/script/job/remove [ find where script=$Script ]; } -- cgit v1.2.3-54-g00ecf