Return early - minimize if indentation

Summary:
Use initializer list to create QSet

Don't check what doesn't needs to be checked.

the QBitArray knows how to deal with true / false
directly, so remove the if's. the speedgain of the
if's are probabely slower than just setting the values
to true / false again anyway as we are not suffering
from a possible branch-prediction, and plus, code is
cleaner.

No need to test for true / false to set true false

Just set it directly

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13512
wilder-portage
Tomaz Canabrava 8 years ago
parent 2c5b7cac93
commit 71e9bb5d60
  1. 24
      src/IncrementalSearchBar.cpp

@ -291,24 +291,8 @@ const QBitArray IncrementalSearchBar::optionsChecked()
void IncrementalSearchBar::setOptions()
{
if (KonsoleSettings::searchCaseSensitive()) {
_caseSensitive->setChecked(true);
} else {
_caseSensitive->setChecked(false);
}
if (KonsoleSettings::searchRegExpression()) {
_regExpression->setChecked(true);
} else {
_regExpression->setChecked(false);
}
if (KonsoleSettings::searchHighlightMatches()) {
_highlightMatches->setChecked(true);
} else {
_highlightMatches->setChecked(false);
}
if (KonsoleSettings::searchReverseSearch()) {
_reverseSearch->setChecked(true);
} else {
_reverseSearch->setChecked(false);
}
_caseSensitive->setChecked(KonsoleSettings::searchCaseSensitive());
_regExpression->setChecked(KonsoleSettings::searchRegExpression());
_highlightMatches->setChecked(KonsoleSettings::searchHighlightMatches());
_reverseSearch->setChecked(KonsoleSettings::searchReverseSearch());
}

Loading…
Cancel
Save