mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
opt: langcoder optimization
This commit is contained in:
parent
af4946d7a7
commit
4e4c9375be
11
langcoder.cc
11
langcoder.cc
|
@ -207,17 +207,14 @@ static GDLangCode LangCodes[] = {
|
|||
{ "zh", "chi", 0, "Chinese" },
|
||||
{ "zu", "zul", -1, "Zulu" },
|
||||
{ "jb", "jbo", 0, "Lojban" },
|
||||
|
||||
{ "", "", 0, "" }
|
||||
};
|
||||
|
||||
LangCoder::LangCoder()
|
||||
{
|
||||
for (int i = 0; true; i++) {
|
||||
const GDLangCode &lc = LangCodes[i];
|
||||
if (lc.lang[0] == 0)
|
||||
break;
|
||||
codeMap[code2toInt(lc.code)] = i;
|
||||
int i = 0;
|
||||
for (const auto lc : LangCodes)
|
||||
{
|
||||
codeMap[ code2toInt( lc.code ) ] = i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue