diff options
author | George Hazan <ghazan@miranda.im> | 2021-04-27 18:50:50 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-04-27 18:50:50 +0300 |
commit | b3ccbd138cc9cdaa3794f9fc44b5c3f6d151ce1d (patch) | |
tree | 4ff6ac1cc07b16d4199f8f74cedeea7c1d5c7c91 /src | |
parent | fc312c6da15bea2a8a819da59e68262bbced3f39 (diff) |
code optimization (minus one cycle)
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/srmm_log.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mir_app/src/srmm_log.cpp b/src/mir_app/src/srmm_log.cpp index d8a3760bad..692922236f 100644 --- a/src/mir_app/src/srmm_log.cpp +++ b/src/mir_app/src/srmm_log.cpp @@ -79,16 +79,16 @@ static bool sttEnableCustomLogs(CMsgDialog *pDlg) CSrmmLogWindow* Srmm_GetLogWindow(CMsgDialog *pDlg) { + CMStringA szViewerName; if (sttEnableCustomLogs(pDlg)) { - ptrA szCurr(db_get_sa(pDlg->m_hContact, "SRMsg", "Logger", "")); - - for (auto &it : g_arLogClasses) - if (!mir_strcmp(szCurr, it->szShortName)) - return it->pfnBuilder(*pDlg); + szViewerName = db_get_sm(pDlg->m_hContact, "SRMsg", "Logger"); + if (szViewerName.IsEmpty()) + szViewerName = db_get_sm(0, "SRMM", "Logger", "built-in"); } + else szViewerName = "built-in"; for (auto &it : g_arLogClasses) - if (!mir_strcmp(it->szShortName, "built-in")) + if (szViewerName == it->szShortName) return it->pfnBuilder(*pDlg); return nullptr; |