From b664fe694df4dc3469bb8a06c7059ee4aad8a5ec Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sun, 22 Dec 2019 22:41:10 -0600 Subject: [PATCH] Small cleanups and fixups --- IPA.Loader/Logging/Logger.cs | 2 +- IPA.Loader/Logging/StandardLogger.cs | 2 +- IPA.Loader/Utilities/Utils.cs | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/IPA.Loader/Logging/Logger.cs b/IPA.Loader/Logging/Logger.cs index 5d9c3441..10e94d9a 100644 --- a/IPA.Loader/Logging/Logger.cs +++ b/IPA.Loader/Logging/Logger.cs @@ -171,7 +171,7 @@ namespace IPA.Logging /// /// Used for when the level is undefined. /// - Undefined = Byte.MaxValue + Undefined = byte.MaxValue } /// diff --git a/IPA.Loader/Logging/StandardLogger.cs b/IPA.Loader/Logging/StandardLogger.cs index 3ff25955..ea77d469 100644 --- a/IPA.Loader/Logging/StandardLogger.cs +++ b/IPA.Loader/Logging/StandardLogger.cs @@ -128,7 +128,7 @@ namespace IPA.Logging logName = $"{parent.logName}/{subName}"; this.parent = parent; printers = new List(); - if (SelfConfig.Debug_.CondenseModLogs_) + if (!SelfConfig.Debug_.CondenseModLogs_) printers.Add(new PluginSubLogPrinter(parent.logName, subName)); if (logThread == null || !logThread.IsAlive) diff --git a/IPA.Loader/Utilities/Utils.cs b/IPA.Loader/Utilities/Utils.cs index 8226d583..c0f5b23c 100644 --- a/IPA.Loader/Utilities/Utils.cs +++ b/IPA.Loader/Utilities/Utils.cs @@ -4,6 +4,7 @@ using System.Text; using System.Linq; using System.Collections.Generic; using Mono.Cecil; +using System.Runtime.CompilerServices; #if NET3 using File = Net3_Proxy.File; #endif @@ -197,11 +198,15 @@ namespace IPA.Utilities } #if NET4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static IEnumerable StrJP(this IEnumerable a) => a; + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static IEnumerable StrJP(this IEnumerable a) => a.Select(o => $"{o}" /* safer than .ToString() */); #endif #if NET3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string[] StrJP(this IEnumerable a) => a.ToArray(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static string[] StrJP(this IEnumerable a) => a.Select(o => $"{o}" /* safer than .ToString() */).ToArray(); #endif }