aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS
diff options
context:
space:
mode:
authorMarco Carvalho <marcolucio27@gmail.com>2023-10-05 07:41:00 -0300
committerGitHub <noreply@github.com>2023-10-05 12:41:00 +0200
commit7835968214241c37c677b6c5c82aa3353546de89 (patch)
tree70e4a1d5fbacf371d1d5eff1d6c025b7ff14f922 /src/Ryujinx.HLE/HOS
parent0aceb534cb34287e354f92c37a1b5ebf136e8e74 (diff)
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>
Diffstat (limited to 'src/Ryujinx.HLE/HOS')
-rw-r--r--src/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs12
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs7
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs6
3 files changed, 13 insertions, 12 deletions
diff --git a/src/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs b/src/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs
index cbfef588..7578f1d2 100644
--- a/src/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs
+++ b/src/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs
@@ -436,14 +436,14 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
uint nameIndex = sym.NameOffset;
- string name = string.Empty;
+ StringBuilder nameBuilder = new();
for (int chr; (chr = memory.Read<byte>(strTblAddr + nameIndex++)) != 0;)
{
- name += (char)chr;
+ nameBuilder.Append((char)chr);
}
- return new ElfSymbol(name, sym.Info, sym.Other, sym.SectionIndex, sym.ValueAddress, sym.Size);
+ return new ElfSymbol(nameBuilder.ToString(), sym.Info, sym.Other, sym.SectionIndex, sym.ValueAddress, sym.Size);
}
private static ElfSymbol GetSymbol32(IVirtualMemoryManager memory, ulong address, ulong strTblAddr)
@@ -452,14 +452,14 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
uint nameIndex = sym.NameOffset;
- string name = string.Empty;
+ StringBuilder nameBuilder = new();
for (int chr; (chr = memory.Read<byte>(strTblAddr + nameIndex++)) != 0;)
{
- name += (char)chr;
+ nameBuilder.Append((char)chr);
}
- return new ElfSymbol(name, sym.Info, sym.Other, sym.SectionIndex, sym.ValueAddress, sym.Size);
+ return new ElfSymbol(nameBuilder.ToString(), sym.Info, sym.Other, sym.SectionIndex, sym.ValueAddress, sym.Size);
}
}
}
diff --git a/src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs b/src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
index 9110d06d..3dc82035 100644
--- a/src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
@@ -8,6 +8,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
+using System.Text;
namespace Ryujinx.HLE.HOS.Services.Sm
{
@@ -235,7 +236,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm
private static string ReadName(ServiceCtx context)
{
- string name = string.Empty;
+ StringBuilder nameBuilder = new();
for (int index = 0; index < 8 &&
context.RequestData.BaseStream.Position <
@@ -245,11 +246,11 @@ namespace Ryujinx.HLE.HOS.Services.Sm
if (chr >= 0x20 && chr < 0x7f)
{
- name += (char)chr;
+ nameBuilder.Append((char)chr);
}
}
- return name;
+ return nameBuilder.ToString();
}
public override void DestroyAtExit()
diff --git a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
index 3fbd7d20..143e2166 100644
--- a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
@@ -142,7 +142,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
// OpenDisplay(nn::vi::DisplayName) -> u64 display_id
public ResultCode OpenDisplay(ServiceCtx context)
{
- string name = "";
+ StringBuilder nameBuilder = new();
for (int index = 0; index < 8 && context.RequestData.BaseStream.Position < context.RequestData.BaseStream.Length; index++)
{
@@ -150,11 +150,11 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
if (chr >= 0x20 && chr < 0x7f)
{
- name += (char)chr;
+ nameBuilder.Append((char)chr);
}
}
- return OpenDisplayImpl(context, name);
+ return OpenDisplayImpl(context, nameBuilder.ToString());
}
[CommandCmif(1011)]