mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24: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" },
|
{ "zh", "chi", 0, "Chinese" },
|
||||||
{ "zu", "zul", -1, "Zulu" },
|
{ "zu", "zul", -1, "Zulu" },
|
||||||
{ "jb", "jbo", 0, "Lojban" },
|
{ "jb", "jbo", 0, "Lojban" },
|
||||||
|
|
||||||
{ "", "", 0, "" }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
LangCoder::LangCoder()
|
LangCoder::LangCoder()
|
||||||
{
|
{
|
||||||
for (int i = 0; true; i++) {
|
int i = 0;
|
||||||
const GDLangCode &lc = LangCodes[i];
|
for (const auto lc : LangCodes)
|
||||||
if (lc.lang[0] == 0)
|
{
|
||||||
break;
|
codeMap[ code2toInt( lc.code ) ] = i++;
|
||||||
codeMap[code2toInt(lc.code)] = i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue