aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-06-28 15:11:42 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-06-28 15:11:42 +0100
commitdb08bfd4cc611f77a6ef125da23a19c67e2cf657 (patch)
tree71863253a2930992b745bafffa1c6d0310e50e67 /src
parent0f7311f9f6787867210d3bce77e7801d1b347dba (diff)
downloadrspamd-db08bfd4cc611f77a6ef125da23a19c67e2cf657.tar.gz
rspamd-db08bfd4cc611f77a6ef125da23a19c67e2cf657.zip
[Minor] Apply review suggestion
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/gpt.lua6
1 files changed, 1 insertions, 5 deletions
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()