From a7e5e613f86963c8bf82248ab044e0ea36e42fbc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Mar 2018 12:09:30 +0300 Subject: LIST<>::indexOf(T**) - fast index calculation for direct iterators --- plugins/SpellChecker/src/spellchecker.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/SpellChecker/src/spellchecker.cpp') diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 4b495303c1..9770861c9c 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -144,12 +144,11 @@ static int ModulesLoaded(WPARAM, LPARAM) sid.section.w = LPGENW("Spell Checker") L"/" LPGENW("Flags"); // Get language flags - for (int i = 0; i < languages.getCount(); i++) { - auto *p = languages[i]; + for (auto &p : languages) { sid.description.w = p->full_name; char lang[32]; - mir_snprintf(lang, "spell_lang_%d", i); + mir_snprintf(lang, "spell_lang_%d", languages.indexOf(&p)); sid.pszName = lang; HICON hFlag = nullptr, hFlagIcoLib = nullptr; -- cgit v1.2.3