mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
using ContainKey instead of getvalueofdefault
This commit is contained in:
parent
c4b81a9429
commit
4ebfba76a3
1 changed files with 4 additions and 5 deletions
|
|
@ -32,21 +32,20 @@ namespace Flow.Launcher.Infrastructure
|
|||
{
|
||||
if (_settings.ShouldUsePinyin)
|
||||
{
|
||||
string result = _pinyinCache.GetValueOrDefault(content);
|
||||
if (result == null)
|
||||
if (_pinyinCache.ContainsKey(content))
|
||||
{
|
||||
if (WordsHelper.HasChinese(content))
|
||||
{
|
||||
result = WordsHelper.GetPinyin(content,";");
|
||||
var result = WordsHelper.GetPinyin(content,";");
|
||||
result = GetFirstPinyinChar(result) + result.Replace(";","");
|
||||
_pinyinCache[content] = result;
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = content;
|
||||
return content;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue