From: Vsevolod Stakhov Date: Fri, 28 Jun 2024 14:11:42 +0000 (+0100) Subject: [Minor] Apply review suggestion X-Git-Tag: 3.9.0~13^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=db08bfd4cc611f77a6ef125da23a19c67e2cf657;p=rspamd.git [Minor] Apply review suggestion --- diff --git a/src/plugins/lua/gpt.lua b/src/plugins/lua/gpt.lua index ca39794c5..79f8882ce 100644 --- a/src/plugins/lua/gpt.lua +++ b/src/plugins/lua/gpt.lua @@ -138,11 +138,7 @@ local function default_condition(task) local words = sel_part:get_words('norm') nwords = #words if nwords > settings.max_tokens then - -- Trim something that does not fit - for i = nwords, settings.max_tokens, -1 do - rawset(words, i, nil) - end - return true, table.concat(words, ' ') + return true, table.concat(words, ' ', 1, settings.max_tokens) end end return true, sel_part:get_content_oneline()