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:
@@ -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")
|
||||
|
||||
|
Reference in New Issue
Block a user