Merge branch 'staged' into dev

This commit is contained in:
YiFang Xiao 2023-09-30 20:42:59 +08:00
commit 6ae6ad8030

View file

@ -887,7 +887,6 @@ static uint32_t buildBtreeNode( IndexedWords::const_iterator & nextIndex,
void IndexedWords::addWord( wstring const & index_word, uint32_t articleOffset, unsigned int maxHeadwordSize )
{
wstring word = gd::removeTrailingZero( index_word );
wchar const * wordBegin = word.c_str();
string::size_type wordSize = word.size();
// Safeguard us against various bugs here. Don't attempt adding words
@ -902,7 +901,10 @@ void IndexedWords::addWord( wstring const & index_word, uint32_t articleOffset,
word = word.substr( 0, nonSpacePos );
else
word = word.substr( 0, maxHeadwordSize );
wordSize = word.size();
}
wchar const * wordBegin = word.c_str();
// Skip any leading whitespace
while ( *wordBegin && Folding::isWhitespace( *wordBegin ) ) {