Redundant check removed

This commit is contained in:
Simon Rozman 2016-04-13 12:41:41 +02:00
parent 5a2fcf7cb2
commit 55c76265df

View File

@ -61,16 +61,14 @@ wxZRColaFrame::wxZRColaFrame() :
memcpy(m_lang, ZRCOLA_LANG_VOID, sizeof(m_lang)); memcpy(m_lang, ZRCOLA_LANG_VOID, sizeof(m_lang));
ZRColaApp *app = ((ZRColaApp*)wxTheApp); ZRColaApp *app = ((ZRColaApp*)wxTheApp);
m_toolDecompLanguage->Clear(); m_toolDecompLanguage->Clear();
if (!app->m_lang_db.idxLng.empty()) { for (size_t i = 0, n = app->m_lang_db.idxLng.size(); i < n; i++) {
for (size_t i = 0, n = app->m_lang_db.idxLng.size(); i < n; i++) { const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[i];
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[i]; wxString label(wxString::FromAscii(lang.id, strnlen(lang.id, sizeof(lang.id))));
wxString label(wxString::FromAscii(lang.id, strnlen(lang.id, sizeof(lang.id)))); if (i < wxID_DECOMP_LANGUAGE_END - wxID_DECOMP_LANGUAGE_START + 1)
if (i < wxID_DECOMP_LANGUAGE_END - wxID_DECOMP_LANGUAGE_START + 1) m_menuDecompLanguage->Insert(i, wxID_DECOMP_LANGUAGE_START + i, label, wxString::Format(_("Select %s language for decomposition"), (const wxStringCharType*)label), wxITEM_RADIO);
m_menuDecompLanguage->Insert(i, wxID_DECOMP_LANGUAGE_START + i, label, wxString::Format(_("Select %s language for decomposition"), (const wxStringCharType*)label), wxITEM_RADIO); m_toolDecompLanguage->Insert(label, i);
m_toolDecompLanguage->Insert(label, i); if (memcmp(m_lang, lang.id, sizeof(m_lang)) == 0)
if (memcmp(m_lang, lang.id, sizeof(m_lang)) == 0) m_toolDecompLanguage->Select(i);
m_toolDecompLanguage->Select(i);
}
} }
// Set focus. // Set focus.