diff --git a/btreeidx.cc b/btreeidx.cc index 39dad39a..0ce035cb 100644 --- a/btreeidx.cc +++ b/btreeidx.cc @@ -1402,7 +1402,7 @@ void BtreeIndex::getHeadwordsFromOffsets( QList & offsets, QList::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; diff --git a/fulltextsearch.cc b/fulltextsearch.cc index 7ad1e5d2..57842817 100644 --- a/fulltextsearch.cc +++ b/fulltextsearch.cc @@ -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();