From a2a5ec75667c4095869743c5d889ff67f5414547 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 4 Apr 2019 00:58:21 +1000 Subject: [PATCH] Replace $"{a}{b}" and similar with concatenation --- BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs | 2 +- BizHawk.Client.EmuHawk/tools/TraceLogger.cs | 4 +++- BizHawk.Common/Extensions/BufferExtensions.cs | 6 +++--- .../DiscFormats/Blobs/RiffMaster.cs | 6 ++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs b/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs index b41fa8779c..2c0cfcb7ed 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs @@ -59,7 +59,7 @@ namespace BizHawk.Client.EmuHawk { int tone = note % 12; int octave = note / 12; - return $"{noteNames[tone]}{octave}"; + return noteNames[tone] + octave; } //this isnt thoroughly debugged but it seems to work OK diff --git a/BizHawk.Client.EmuHawk/tools/TraceLogger.cs b/BizHawk.Client.EmuHawk/tools/TraceLogger.cs index e1ce7d14d3..5516f31055 100644 --- a/BizHawk.Client.EmuHawk/tools/TraceLogger.cs +++ b/BizHawk.Client.EmuHawk/tools/TraceLogger.cs @@ -413,7 +413,9 @@ namespace BizHawk.Client.EmuHawk private void StartLogFile(bool append = false) { var data = Tracer.Header; - _streamWriter = new StreamWriter($"{_baseName}{(_segmentCount == 0 ? string.Empty : $"_{_segmentCount}")}{_extension}", append); + _streamWriter = new StreamWriter( + string.Concat(_baseName, _segmentCount == 0 ? string.Empty : $"_{_segmentCount}", _extension), + append); _streamWriter.WriteLine(data); if (append) { diff --git a/BizHawk.Common/Extensions/BufferExtensions.cs b/BizHawk.Common/Extensions/BufferExtensions.cs index d02ded6d2e..c2534a3e39 100644 --- a/BizHawk.Common/Extensions/BufferExtensions.cs +++ b/BizHawk.Common/Extensions/BufferExtensions.cs @@ -100,7 +100,7 @@ namespace BizHawk.Common.BufferExtensions for (int i = 0; i < buffer.Length && i * 2 < hex.Length; i++) { - var bytehex = $"{hex[i * 2]}{hex[(i * 2) + 1]}"; + var bytehex = hex[i * 2].ToString() + hex[(i * 2) + 1]; buffer[i] = byte.Parse(bytehex, NumberStyles.HexNumber); } } @@ -136,7 +136,7 @@ namespace BizHawk.Common.BufferExtensions for (int i = 0; i < buffer.Length && i * 4 < hex.Length; i++) { - var shorthex = $"{hex[i * 4]}{hex[(i * 4) + 1]}{hex[(i * 4) + 2]}{hex[(i * 4) + 3]}"; + var shorthex = string.Concat(hex[i * 4], hex[(i * 4) + 1], hex[(i * 4) + 2], hex[(i * 4) + 3]); buffer[i] = short.Parse(shorthex, NumberStyles.HexNumber); } } @@ -150,7 +150,7 @@ namespace BizHawk.Common.BufferExtensions for (int i = 0; i < buffer.Length && i * 4 < hex.Length; i++) { - var ushorthex = $"{hex[i * 4]}{hex[(i * 4) + 1]}{hex[(i * 4) + 2]}{hex[(i * 4) + 3]}"; + var ushorthex = string.Concat(hex[i * 4], hex[(i * 4) + 1], hex[(i * 4) + 2], hex[(i * 4) + 3]); buffer[i] = ushort.Parse(ushorthex, NumberStyles.HexNumber); } } diff --git a/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs index e8f2bd143d..197f3ab283 100644 --- a/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs +++ b/BizHawk.Emulation.DiscSystem/DiscFormats/Blobs/RiffMaster.cs @@ -40,10 +40,8 @@ namespace BizHawk.Emulation.DiscSystem BaseStream = null; } - private static string ReadTag(BinaryReader br) - { - return $"{br.ReadChar()}{br.ReadChar()}{br.ReadChar()}{br.ReadChar()}"; - } + private static string ReadTag(BinaryReader br) => + string.Concat(br.ReadChar(), br.ReadChar(), br.ReadChar(), br.ReadChar()); protected static void WriteTag(BinaryWriter bw, string tag) {