History

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.

Dudemanguy committed 3 years ago

Commit fcc67cc1 parent 56fada15 files · +146 −147Browse files

Showing the changes to player/lua/options.lua (1 of 5 files). Show all

Unified · Split

player/lua/options.lua+1−1
@@ -12,7 +12,7 @@ local function typeconv(desttypeval, val) · 11 unmodified lines
1212 val = nil
1313 end
1414 elseif type(desttypeval) == "number" then
15− if not (tonumber(val) == nil) then
15+ if tonumber(val) ~= nil then
1616 val = tonumber(val)
1717 else
1818 msg.error("Error: Can't convert '" .. val .. "' to number!")

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t