File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,10 +69,17 @@ static const PhaseInfo PHASE_TABLE[] = {
6969 * Uses contains() because ShowProgress may prepend the wallet name. */
7070static const PhaseInfo* LookupPhase (const QString& message)
7171{
72- for (const auto & phase : PHASE_TABLE ) {
73- QString translated = QString::fromStdString (_ (phase.msg_key ).translated );
72+ static const auto cache = [] {
73+ std::vector<std::pair<const PhaseInfo*, QString>> phases_with_translations;
74+ for (const auto & phase : PHASE_TABLE ) {
75+ phases_with_translations.push_back ({&phase, QString::fromStdString (_ (phase.msg_key ).translated )});
76+ }
77+ return phases_with_translations;
78+ }();
79+
80+ for (const auto & [phase, translated] : cache) {
7481 if (message.contains (translated, Qt::CaseInsensitive)) {
75- return & phase;
82+ return phase;
7683 }
7784 }
7885 return nullptr ;
You can’t perform that action at this time.
0 commit comments