From 15d26dd86f24f79e76501b517f8fcf7aa5709de4 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 24 Dec 2014 13:59:08 -0800 Subject: [PATCH] Slightly speed up karaskel.collect_head --- automation/include/karaskel-auto4.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/automation/include/karaskel-auto4.lua b/automation/include/karaskel-auto4.lua index 3edd88152..08bba2ea3 100644 --- a/automation/include/karaskel-auto4.lua +++ b/automation/include/karaskel-auto4.lua @@ -52,9 +52,8 @@ function karaskel.collect_head(subs, generate_furigana) end -- First pass: collect all existing styles and get resolution info - for i = 1, #subs do + for _, l in ipairs(subs) do if aegisub.progress.is_cancelled() then error("User cancelled") end - local l = subs[i] if l.class == "style" then if not first_style_line then first_style_line = i end @@ -80,6 +79,8 @@ function karaskel.collect_head(subs, generate_furigana) -- Also look for script resolution local k = l.key:lower() meta[k] = l.value + else + break end end