summaryrefslogtreecommitdiffstats
path: root/player/lua/stats.lua
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-10-30 20:23:21 -0500
committerDudemanguy <random342@airmail.cc>2023-11-02 16:03:20 +0000
commitfcc67cc6c1bfec01f328fb9ba20e0ee9f559dad7 (patch)
tree4c9a75b3ec50caf5ac696201b850aebbd290ecfa /player/lua/stats.lua
parent56fada1a5eacb06b9f4bcb359390b3e561334346 (diff)
downloadmpv-fcc67cc6c1bfec01f328fb9ba20e0ee9f559dad7.tar.bz2
mpv-fcc67cc6c1bfec01f328fb9ba20e0ee9f559dad7.tar.xz
lua: remove a ton of unneeded parentheses
For whatever reason, some of the lua code (particularly the osc and ytdl_hook) is full of a bunch of stuff like if (foo), if not (foo == nil), etc. The parenthesis aren't needed in lua and actually just look weird since nobody actually writes lua like this. You can see most of the other conditionals are written normally. So cleanup the style to match when the parenthesis clearly aren't doing anything. Not directly related, but also add some spaces on a few math operations while we're at it.
Diffstat (limited to 'player/lua/stats.lua')
-rw-r--r--player/lua/stats.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index 1b7ad725b8..1803313f88 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -1092,7 +1092,7 @@ local function cache_stats()
append(stats, opt_time(a) .. " - " .. opt_time(b), {prefix = "Packet queue:"})
local r = nil
- if (a ~= nil) and (b ~= nil) then
+ if a ~= nil and b ~= nil then
r = b - a
end
@@ -1174,7 +1174,7 @@ local function record_cache_stats()
local a = info["reader-pts"]
local b = info["cache-end"]
- if (a ~= nil) and (b ~= nil) then
+ if a ~= nil and b ~= nil then
graph_add_value(cache_ahead_buf, b - a)
end
@@ -1274,7 +1274,7 @@ local function unbind_scroll()
end
end
local function update_scroll_bindings(k)
- if (pages[k].scroll) then
+ if pages[k].scroll then
bind_scroll()
else
unbind_scroll()