mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Simple refactor
This commit is contained in:
parent
fba42fff17
commit
b31a7408d3
1 changed files with 6 additions and 12 deletions
|
|
@ -30,18 +30,12 @@ namespace Flow.Launcher.Infrastructure
|
|||
|
||||
public (string translation, TranslationMapping map) Translate(string content)
|
||||
{
|
||||
if (_settings.ShouldUsePinyin)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
return BuildCacheFromContent(content);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// return value;
|
||||
//}
|
||||
}
|
||||
return (content, null);
|
||||
if (!_settings.ShouldUsePinyin)
|
||||
return (content, null);
|
||||
|
||||
return _pinyinCache.TryGetValue(content, out var value)
|
||||
? value
|
||||
: BuildCacheFromContent(content);
|
||||
}
|
||||
|
||||
private (string translation, TranslationMapping map) BuildCacheFromContent(string content)
|
||||
|
|
|
|||
Loading…
Reference in a new issue