make logic clearer, remove second call to size

This commit is contained in:
Akash Mozumdar 2021-11-06 06:09:07 -06:00
parent 663bb97fff
commit 4b67b8a5cf

View File

@ -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: