fix: regression introduce by replacing qBinaryFind

This commit is contained in:
Xiao YiFang 2022-06-03 15:33:16 +08:00
parent 80021a6328
commit e26db104f7
2 changed files with 2 additions and 2 deletions

View file

@ -1402,7 +1402,7 @@ void BtreeIndex::getHeadwordsFromOffsets( QList<uint32_t> & offsets,
QList<uint32_t>::Iterator it = std::lower_bound( begOffsets, endOffsets,
articleOffset );
if( it!=offsets.end())
if( it != offsets.end() && *it == articleOffset )
{
if( isCancelled && Utils::AtomicInt::loadAcquire( *isCancelled ) )
return;

View file

@ -621,7 +621,7 @@ Q_UNUSED( parent );
for( int x = 0; x < hws.length(); x++ )
{
QList< FtsHeadword >::iterator it = std::lower_bound( headwords.begin(), headwords.end(), hws.at( x ) );
if( it != headwords.end() )
if( it != headwords.end() && *it == hws.at( x ) )
{
it->dictIDs.push_back( hws.at( x ).dictIDs.front() );
for( QStringList::const_iterator itr = it->foundHiliteRegExps.constBegin();