mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-22 15:27:10 +02:00
misc: Replace "" with string.Empty.
This commit is contained in:
parent
9305d171e7
commit
139c195eb7
52 changed files with 1649 additions and 1636 deletions
|
@ -523,7 +523,7 @@ namespace Ryujinx.HLE.FileSystem
|
|||
{
|
||||
// Clean up the name and get the NcaId
|
||||
|
||||
string[] pathComponents = entry.FullName.Replace(".cnmt", "").Split('/');
|
||||
string[] pathComponents = entry.FullName.Replace(".cnmt", string.Empty).Split('/');
|
||||
|
||||
string ncaId = pathComponents[^1];
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace Ryujinx.HLE.FileSystem
|
|||
|
||||
if (systemPath.StartsWith(baseSystemPath))
|
||||
{
|
||||
string rawPath = systemPath.Replace(baseSystemPath, "");
|
||||
string rawPath = systemPath.Replace(baseSystemPath, string.Empty);
|
||||
int firstSeparatorOffset = rawPath.IndexOf(Path.DirectorySeparatorChar);
|
||||
|
||||
if (firstSeparatorOffset == -1)
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
|||
|
||||
private static string CleanText(string value)
|
||||
{
|
||||
return CleanTextRegex().Replace(value, "").Replace("\0", "");
|
||||
return CleanTextRegex().Replace(value, string.Empty).Replace("\0", string.Empty);
|
||||
}
|
||||
|
||||
private string GetMessageText(uint module, uint description, string key)
|
||||
|
@ -129,17 +129,15 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
|||
|
||||
return CleanText(reader.ReadToEnd());
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private string[] GetButtonsText(uint module, uint description, string key)
|
||||
{
|
||||
string buttonsText = GetMessageText(module, description, key);
|
||||
|
||||
return (buttonsText == "") ? null : buttonsText.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
|
||||
return (buttonsText == string.Empty) ? null : buttonsText.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);
|
||||
}
|
||||
|
||||
private void ParseErrorCommonArg()
|
||||
|
@ -156,7 +154,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
|||
|
||||
string message = GetMessageText(module, description, "DlgMsg");
|
||||
|
||||
if (message == "")
|
||||
if (message == string.Empty)
|
||||
{
|
||||
message = "An error has occured.\n\nPlease try again later.";
|
||||
}
|
||||
|
@ -190,7 +188,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
|||
|
||||
// TODO: Handle the LanguageCode to return the translated "OK" and "Details".
|
||||
|
||||
if (detailsText.Trim() != "")
|
||||
if (detailsText.Trim() != string.Empty)
|
||||
{
|
||||
buttons.Add("Details");
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace Ryujinx.HLE.HOS.Applets
|
|||
|
||||
private byte[] _transferMemory;
|
||||
|
||||
private string _textValue = "";
|
||||
private string _textValue = string.Empty;
|
||||
private int _cursorBegin = 0;
|
||||
private Encoding _encoding = Encoding.Unicode;
|
||||
private KeyboardResult _lastResult = KeyboardResult.NotSet;
|
||||
|
|
|
@ -305,7 +305,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
|||
{
|
||||
SKRect bounds = SKRect.Empty;
|
||||
|
||||
if (text == "")
|
||||
if (text == string.Empty)
|
||||
{
|
||||
paint.MeasureText(" ", ref bounds);
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
|||
{
|
||||
SKRect bounds = SKRect.Empty;
|
||||
|
||||
if (text == "")
|
||||
if (text == string.Empty)
|
||||
{
|
||||
paint.MeasureText(" ", ref bounds);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
|||
/// </summary>
|
||||
internal class SoftwareKeyboardUIState
|
||||
{
|
||||
public string InputText = "";
|
||||
public string InputText = string.Empty;
|
||||
public int CursorBegin = 0;
|
||||
public int CursorEnd = 0;
|
||||
public bool AcceptPressed = false;
|
||||
|
|
|
@ -238,7 +238,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||
}
|
||||
else
|
||||
{
|
||||
info.SubName = "";
|
||||
info.SubName = string.Empty;
|
||||
}
|
||||
|
||||
info.ImageName = GetGuessedNsoNameFromIndex(imageIndex);
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
|||
{
|
||||
if (userId.IsNull)
|
||||
{
|
||||
userId = new UserId(Guid.NewGuid().ToString().Replace("-", ""));
|
||||
userId = new UserId(Guid.NewGuid().ToString().Replace("-", string.Empty));
|
||||
}
|
||||
|
||||
UserProfile profile = new(userId, name, image);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using Gommon;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Utilities;
|
||||
|
@ -143,7 +144,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm
|
|||
if (decompressedLdnData.Length != header.DecompressLength)
|
||||
{
|
||||
Logger.Error?.PrintMsg(LogClass.ServiceLdn, $"Decompress error: length does not match. ({decompressedLdnData.Length} != {header.DecompressLength})");
|
||||
Logger.Error?.PrintMsg(LogClass.ServiceLdn, $"Decompress error data: '{string.Join("", decompressedLdnData.Select(x => (int)x).ToArray())}'");
|
||||
Logger.Error?.PrintMsg(LogClass.ServiceLdn, $"Decompress error data: '{decompressedLdnData.Select(x => (int)x).JoinToString(string.Empty)}'");
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Ngct
|
|||
ulong bufferSize = context.Request.PtrBuff[0].Size;
|
||||
|
||||
bool isMatch = false;
|
||||
string text = "";
|
||||
string text = string.Empty;
|
||||
|
||||
if (bufferSize != 0)
|
||||
{
|
||||
|
@ -57,8 +57,8 @@ namespace Ryujinx.HLE.HOS.Services.Ngct
|
|||
|
||||
ulong bufferFilteredPosition = context.Request.RecvListBuff[0].Position;
|
||||
|
||||
string text = "";
|
||||
string textFiltered = "";
|
||||
string text = string.Empty;
|
||||
string textFiltered = string.Empty;
|
||||
|
||||
if (bufferSize != 0)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Nsd.Manager
|
|||
// TODO: Load Environment from the savedata.
|
||||
address = address.Replace("%", IManager.NsdSettings.Environment);
|
||||
|
||||
resolvedAddress = "";
|
||||
resolvedAddress = string.Empty;
|
||||
|
||||
if (IManager.NsdSettings == null)
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
|||
|
||||
if (size < 0)
|
||||
{
|
||||
return "";
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
ReadOnlySpan<byte> data = ReadInPlace((size + 1) * 2);
|
||||
|
|
|
@ -166,7 +166,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
|
|||
|
||||
private ResultCode OpenDisplayImpl(ServiceCtx context, string name)
|
||||
{
|
||||
if (name == "")
|
||||
if (name == string.Empty)
|
||||
{
|
||||
return ResultCode.InvalidValue;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace Ryujinx.HLE.Loaders.Executables
|
|||
Match fsSdkMatch = FsSdkRegex().Match(rawTextBuffer);
|
||||
if (fsSdkMatch.Success)
|
||||
{
|
||||
stringBuilder.AppendLine($" FS SDK Version: {fsSdkMatch.Value.Replace("sdk_version: ", "")}");
|
||||
stringBuilder.AppendLine($" FS SDK Version: {fsSdkMatch.Value.Replace("sdk_version: ", string.Empty)}");
|
||||
}
|
||||
|
||||
MatchCollection sdkMwMatches = SdkMwRegex().Matches(rawTextBuffer);
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
|
|||
Logger.Warning?.Print(LogClass.Ptc, "Detected unsupported ExeFs modifications. PTC disabled.");
|
||||
}
|
||||
|
||||
string programName = "";
|
||||
string programName = string.Empty;
|
||||
|
||||
if (!isHomebrew && programId > 0x010000000000FFFF)
|
||||
{
|
||||
|
|
|
@ -145,7 +145,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
IFileSystem dummyExeFs = null;
|
||||
Stream romfsStream = null;
|
||||
|
||||
string programName = "";
|
||||
string programName = string.Empty;
|
||||
ulong programId = 0000000000000000;
|
||||
|
||||
// Load executable.
|
||||
|
|
|
@ -255,7 +255,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
{
|
||||
NsoExecutable nso => Convert.ToHexString(nso.BuildId.ItemsRo.ToArray()),
|
||||
NroExecutable nro => Convert.ToHexString(nro.Header.BuildId),
|
||||
_ => "",
|
||||
_ => string.Empty
|
||||
}).ToUpper());
|
||||
|
||||
ulong[] nsoBase = new ulong[executables.Length];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue