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.
This commit is contained in:
Dudemanguy committed 2023-11-02 16:03:20 +00:00
1 parent 56fada1a5e
commit fcc67cc6c1
5 files changed
+146 -147

No files matched your search

+3 -3
View File
@@ -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()