scripts: don't use 'local' for file-wide scoped variables

Since all scripts run in a sandbox with their own global environment,
it means that they don't interfere with each other's global variables.
Therefore, all file-wide variables can be declared global without
any change in behavior. In my understanding, it is better to do so
because this means that any code accessing those variables is going
to access them directly from the global environment table with a simple
lookup rather than having each variable referenced in the local closure
of each function separately.
This commit is contained in:
George Kiagiadakis
2023-09-29 23:13:28 +03:00
parent 2f89c64b7f
commit 43aa2d4952
32 changed files with 75 additions and 69 deletions

View File

@@ -5,8 +5,8 @@
--
-- SPDX-License-Identifier: MIT
local cutils = require ("common-utils")
local mutils = require ("monitor-utils")
cutils = require ("common-utils")
mutils = require ("monitor-utils")
log = Log.open_topic ("s-monitors-libcam")