From 663bb97fff497b030e83788194f3592544be70ee Mon Sep 17 00:00:00 2001 From: Blu3train Date: Fri, 1 Oct 2021 09:44:45 +0200 Subject: [PATCH] fix rateLimitTimespan issue #665 --- extensions/translatewrapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/translatewrapper.cpp b/extensions/translatewrapper.cpp index 8678650..4dced67 100644 --- a/extensions/translatewrapper.cpp +++ b/extensions/translatewrapper.cpp @@ -166,7 +166,8 @@ bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) tokens.push(token); // popped one too many break; } - tokens.push(current); + if (tokens.size() < tokenCount) tokens.push(current); + else return false; return tokens.size() <= tokenCount; }