Strings should not be concatenated using '+' in a loop (#5664)
* Strings should not be concatenated using '+' in a loop * fix IDE0090 * undo GenerateLoadOrStore * prefer string interpolation * Update src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGen.cs Co-authored-by: Mary <thog@protonmail.com> --------- Co-authored-by: Mary <thog@protonmail.com>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Ryujinx.Ui.LocaleGenerator
|
||||
{
|
||||
@ -15,15 +16,17 @@ namespace Ryujinx.Ui.LocaleGenerator
|
||||
context.RegisterSourceOutput(contents, (spc, content) =>
|
||||
{
|
||||
var lines = content.Split('\n').Where(x => x.Trim().StartsWith("\"")).Select(x => x.Split(':')[0].Trim().Replace("\"", ""));
|
||||
string enumSource = "namespace Ryujinx.Ava.Common.Locale;\n";
|
||||
enumSource += "internal enum LocaleKeys\n{\n";
|
||||
StringBuilder enumSourceBuilder = new();
|
||||
enumSourceBuilder.AppendLine("namespace Ryujinx.Ava.Common.Locale;");
|
||||
enumSourceBuilder.AppendLine("internal enum LocaleKeys");
|
||||
enumSourceBuilder.AppendLine("{");
|
||||
foreach (var line in lines)
|
||||
{
|
||||
enumSource += $" {line},\n";
|
||||
enumSourceBuilder.AppendLine($" {line},");
|
||||
}
|
||||
enumSource += "}\n";
|
||||
enumSourceBuilder.AppendLine("}");
|
||||
|
||||
spc.AddSource("LocaleKeys", enumSource);
|
||||
spc.AddSource("LocaleKeys", enumSourceBuilder.ToString());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user