From 908c2ca8ffa688e37da3e7a84605f22839508f7e Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Sat, 16 Dec 2023 22:46:37 -0700 Subject: [PATCH] Update NativeAOT build settings and use ToLowerInvariant --- src/hactoolnet/CliParser.cs | 6 +++--- src/hactoolnet/ProcessBench.cs | 2 +- src/hactoolnet/hactoolnet.csproj | 15 +++++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/hactoolnet/CliParser.cs b/src/hactoolnet/CliParser.cs index 1aae7e34..b2f79e66 100644 --- a/src/hactoolnet/CliParser.cs +++ b/src/hactoolnet/CliParser.cs @@ -126,11 +126,11 @@ internal static class CliParser if (args[i].Length == 2 && (args[i][0] == '-' || args[i][0] == '/')) { - arg = args[i][1].ToString().ToLower(); + arg = args[i][1].ToString().ToLowerInvariant(); } else if (args[i].Length > 2 && (args[i][0] == '-' && args[i][1] == '-')) { - arg = args[i].Substring(2).ToLower(); + arg = args[i].Substring(2).ToLowerInvariant(); } else { @@ -176,7 +176,7 @@ internal static class CliParser private static FileType ParseFileType(Options options, string input) { - switch (input.ToLower()) + switch (input.ToLowerInvariant()) { case "nca": return FileType.Nca; case "pfs0": return FileType.Pfs0; diff --git a/src/hactoolnet/ProcessBench.cs b/src/hactoolnet/ProcessBench.cs index 6d313bec..a12c0b4a 100644 --- a/src/hactoolnet/ProcessBench.cs +++ b/src/hactoolnet/ProcessBench.cs @@ -388,7 +388,7 @@ internal static class ProcessBench { CpuFrequency = ctx.Options.CpuFrequencyGhz * 1_000_000_000; - switch (ctx.Options.BenchType?.ToLower()) + switch (ctx.Options.BenchType?.ToLowerInvariant()) { case "aesctr": { diff --git a/src/hactoolnet/hactoolnet.csproj b/src/hactoolnet/hactoolnet.csproj index 5f4413d7..9c416047 100644 --- a/src/hactoolnet/hactoolnet.csproj +++ b/src/hactoolnet/hactoolnet.csproj @@ -30,15 +30,22 @@ true - false - Speed - false - + true NATIVEAOT_NO_REFLECTION;$(DefineConstants) + + Size + true + false + + + + + +