diff --git a/src/headwordsmodel.cc b/src/headwordsmodel.cc index 29e3f85a2..837482118 100644 --- a/src/headwordsmodel.cc +++ b/src/headwordsmodel.cc @@ -46,7 +46,7 @@ void HeadwordListModel::setFilter( QRegularExpression reg ) if ( reg.pattern().isEmpty() ) { QMutexLocker _( &lock ); //race condition. - if(!filtering){ + if ( !filtering ) { return; } filtering = false; @@ -60,14 +60,13 @@ void HeadwordListModel::setFilter( QRegularExpression reg ) return; } - else{ + else { QMutexLocker _( &lock ); //the first time to enter filtering mode. - if(!filtering){ + if ( !filtering ) { filtering = true; original_words << words; } - } filterWords.clear(); auto sr = _dict->prefixMatch( gd::removeTrailingZero( reg.pattern() ), maxFilterResults );