Skip to content

Commit a8a305f

Browse files
committed
Improve code quality
1 parent 9e8a950 commit a8a305f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Flow.Launcher.Infrastructure/PinyinAlphabet.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Collections.Concurrent;
2-
using System.Text;
3-
using Flow.Launcher.Infrastructure.UserSettings;
4-
using ToolGood.Words.Pinyin;
52
using System.Collections.Generic;
63
using System.Collections.ObjectModel;
4+
using System.Text;
75
using CommunityToolkit.Mvvm.DependencyInjection;
6+
using Flow.Launcher.Infrastructure.UserSettings;
7+
using ToolGood.Words.Pinyin;
88

99
namespace Flow.Launcher.Infrastructure
1010
{
@@ -52,12 +52,12 @@ public bool ShouldTranslate(string stringToTranslate)
5252

5353
var resultList = WordsHelper.GetPinyinList(content);
5454

55-
StringBuilder resultBuilder = new StringBuilder();
56-
TranslationMapping map = new TranslationMapping();
55+
var resultBuilder = new StringBuilder();
56+
var map = new TranslationMapping();
5757

58-
bool pre = false;
58+
var pre = false;
5959

60-
for (int i = 0; i < resultList.Length; i++)
60+
for (var i = 0; i < resultList.Length; i++)
6161
{
6262
if (content[i] >= 0x3400 && content[i] <= 0x9FD5)
6363
{
@@ -148,7 +148,7 @@ public bool ShouldTranslate(string stringToTranslate)
148148
private static string ToDoublePin(string fullPinyin)
149149
{
150150
// Assuming s is valid
151-
StringBuilder doublePin = new StringBuilder();
151+
var doublePin = new StringBuilder();
152152

153153
if (fullPinyin.Length <= 3 && (fullPinyin[0] == 'a' || fullPinyin[0] == 'e' || fullPinyin[0] == 'o'))
154154
{

0 commit comments

Comments
 (0)