From 4b67b8a5cf8aea0a6bad6f35e6e8918b3d5c9f3d Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sat, 6 Nov 2021 06:09:07 -0600 Subject: [PATCH] make logic clearer, remove second call to size --- extensions/translatewrapper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/translatewrapper.cpp b/extensions/translatewrapper.cpp index 4dced67..f74fad7 100644 --- a/extensions/translatewrapper.cpp +++ b/extensions/translatewrapper.cpp @@ -166,9 +166,9 @@ bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) tokens.push(token); // popped one too many break; } - if (tokens.size() < tokenCount) tokens.push(current); - else return false; - return tokens.size() <= tokenCount; + bool available = tokens.size() < tokenCount; + if (available) tokens.push(current); + return available; } private: