0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

options.lua: avoid unnecessary on_update calls

The script was set up to only call on_update when the changelist
was non-empty. However, since the size operator does not operate
on dicts, it always returned 0 (which is truthy), thus on_update
would always be called when the script-opts property changed.
This commit is contained in:
Oscar Manglaras 2020-01-28 00:37:02 +10:30 committed by sfan5
parent a2eee88ccc
commit c99cc13526

View File

@ -152,7 +152,7 @@ local function read_options(options, identifier, on_update)
end
end
last_opts = new_opts
if #changelist then
if next(changelist) ~= nil then
on_update(changelist)
end
end)