Commit: 4e7c6bcb35221be6d9c992a7d8cfe1392f89e2ca Parent: 8724cbccaea39c6177d663670899cdaa09c79757 Author: Ren Tatsumoto Date: Tue, 22 Sep 2020 04:23:46 +0300 avoid memory allocations Diffstat:
| M | subs2srs.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()