Skip to content

Commit 4062fe4

Browse files
committed
refactor: 移除本地化格式化中的冗余颜色缓存
1 parent bbc311a commit 4062fe4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

VModer.Core/Services/GameResource/Localization/LocalizationFormatService.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,10 @@ private TextFormatInfo GetColorText(LocalizationFormatInfo format)
148148

149149
if (localizationTextColorsService.TryGetColor(format.Text[0], out var colorInfo))
150150
{
151-
if (!_colors.TryGetValue(format.Text[0], out var brush))
152-
{
153-
_colors.Add(format.Text[0], brush);
154-
}
155-
return new TextFormatInfo(format.Text[1..], brush);
151+
return new TextFormatInfo(format.Text[1..], colorInfo.Color);
156152
}
157153
}
158154

159155
return new TextFormatInfo(format.Text, Color.Black);
160156
}
161-
162-
private readonly Dictionary<char, Color> _colors = [];
163157
}

0 commit comments

Comments
 (0)