mpv2oboeru

mpv helpers to create flashcards from movies and TV shows
git clone anongit@rnpnr.xyz:mpv2oboeru.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 4e7c6bcb35221be6d9c992a7d8cfe1392f89e2ca
Parent: 8724cbccaea39c6177d663670899cdaa09c79757
Author: Ren Tatsumoto
Date:   Tue, 22 Sep 2020 04:23:46 +0300

avoid memory allocations

Diffstat:
Msubs2srs.lua | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/subs2srs.lua b/subs2srs.lua @@ -647,11 +647,11 @@ subs.get_timing = function(position) end subs.get_text = function() - local text = '' - for _, value in ipairs(subs.list) do - text = text .. value['text'] + local speech = {} + for _, sub in ipairs(subs.list) do + table.insert(speech, sub['text']) end - return text + return table.concat(speech) end subs.get = function()