mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34: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 )
|
void MainWindow::addWordToHistory( const QString & word )
|
||||||
{
|
{
|
||||||
QRegularExpressionMatch m = RX::Epwing::refWord.match( word );
|
if(QRegularExpressionMatch m = RX::Epwing::refWord.match( word ); m.hasMatch() )
|
||||||
if( m.hasMatch() )
|
|
||||||
return;
|
return;
|
||||||
history.addItem( History::Item( 1, word.trimmed() ) );
|
history.addItem( History::Item( 1, word.trimmed() ) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue