mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
fix: sonarcloud analysis
if,switch, and range-based for loop initializer should be used to reduce scope of variables cpp:S6004
This commit is contained in:
parent
736a9aad23
commit
d4c285226c
|
@ -4200,8 +4200,7 @@ void MainWindow::focusWordList()
|
|||
|
||||
void MainWindow::addWordToHistory( const QString & word )
|
||||
{
|
||||
QRegularExpressionMatch m = RX::Epwing::refWord.match( word );
|
||||
if( m.hasMatch() )
|
||||
if(QRegularExpressionMatch m = RX::Epwing::refWord.match( word ); m.hasMatch() )
|
||||
return;
|
||||
history.addItem( History::Item( 1, word.trimmed() ) );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue