Commit: 15899f9673e78fc37a54dc62737a9c3495f56e2f
Parent: 551a40dd5bd76c5456a54abd1da528e3329486c3
Author: Ren Tatsumoto
Date: Thu, 13 May 2021 23:57:07 +0300
replace bad loop with good loop
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -259,9 +259,10 @@ local function cut_episode_number(filename)
}
local s, e, episode = nil, nil, nil
- for i= 1, #ep_num_patterns do
+
+ for _, pattern in pairs(ep_num_patterns) do
if episode ~= nil then break end
- s, e, episode = string.find(tmp_name, ep_num_patterns[i])
+ s, e, episode = string.find(tmp_name, pattern)
end
-- Returns the original filename and no episode number if nothing found.