We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fba42ff commit b31a740Copy full SHA for b31a740
Flow.Launcher.Infrastructure/PinyinAlphabet.cs
@@ -30,18 +30,12 @@ public bool ShouldTranslate(string stringToTranslate)
30
31
public (string translation, TranslationMapping map) Translate(string content)
32
{
33
- if (_settings.ShouldUsePinyin)
34
- {
35
- if (true)
36
37
- return BuildCacheFromContent(content);
38
- }
39
- //else
40
- //{
41
- // return value;
42
- //}
43
44
- return (content, null);
+ if (!_settings.ShouldUsePinyin)
+ return (content, null);
+
+ return _pinyinCache.TryGetValue(content, out var value)
+ ? value
+ : BuildCacheFromContent(content);
45
}
46
47
private (string translation, TranslationMapping map) BuildCacheFromContent(string content)
0 commit comments