Resolves Warning HAA0601
Value type to reference type conversion causes boxing at call site, and unboxing at the callee-site. Resolves by explicitly converting value to string before including it in a log message string.
This commit is contained in:
parent
b3c9f5bdd4
commit
3faeb80e55
@ -33,7 +33,7 @@ public static class BotParser
|
|||||||
DiskHelpers.CreateDirIfDoesntExist(dumpPath);
|
DiskHelpers.CreateDirIfDoesntExist(dumpPath);
|
||||||
|
|
||||||
var botFiles = Directory.GetFiles(dumpPath, "*.json", SearchOption.TopDirectoryOnly);
|
var botFiles = Directory.GetFiles(dumpPath, "*.json", SearchOption.TopDirectoryOnly);
|
||||||
LoggingHelpers.LogToConsole($"{botFiles.Length} bot dump files found");
|
LoggingHelpers.LogToConsole($"{botFiles.Length.ToString()} bot dump files found");
|
||||||
|
|
||||||
// Store a list of parsed bots so we don't parse the same bot twice
|
// Store a list of parsed bots so we don't parse the same bot twice
|
||||||
int totalDupeCount = 0;
|
int totalDupeCount = 0;
|
||||||
@ -42,7 +42,7 @@ public static class BotParser
|
|||||||
foreach (var filePath in botFiles)
|
foreach (var filePath in botFiles)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
if (i % 100 == 0) Console.WriteLine($"Processing file {i}");
|
if (i % 100 == 0) Console.WriteLine($"Processing file {i.ToString()}");
|
||||||
ProcessBotFileSync(baseBots, filePath, parsedBotIds, totalDupeCount);
|
ProcessBotFileSync(baseBots, filePath, parsedBotIds, totalDupeCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ public static class BotParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
stopwatch.Stop();
|
stopwatch.Stop();
|
||||||
LoggingHelpers.LogToConsole($"{totalDupeCount} dupes were ignored. Took {LoggingHelpers.LogTimeTaken(stopwatch.Elapsed.TotalSeconds)} seconds");
|
LoggingHelpers.LogToConsole($"{totalDupeCount.ToString()} dupes were ignored. Took {LoggingHelpers.LogTimeTaken(stopwatch.Elapsed.TotalSeconds)} seconds");
|
||||||
|
|
||||||
return baseBots.ToList();
|
return baseBots.ToList();
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ public static class BotParser
|
|||||||
DiskHelpers.CreateDirIfDoesntExist(dumpPath);
|
DiskHelpers.CreateDirIfDoesntExist(dumpPath);
|
||||||
|
|
||||||
var botFiles = Directory.GetFiles(dumpPath, "*.json", SearchOption.TopDirectoryOnly);
|
var botFiles = Directory.GetFiles(dumpPath, "*.json", SearchOption.TopDirectoryOnly);
|
||||||
LoggingHelpers.LogToConsole($"{botFiles.Length} bot dump files found");
|
LoggingHelpers.LogToConsole($"{botFiles.Length.ToString()} bot dump files found");
|
||||||
|
|
||||||
// key = bot type
|
// key = bot type
|
||||||
// Store bots keyed against their ID so we never get duplicates
|
// Store bots keyed against their ID so we never get duplicates
|
||||||
@ -153,9 +153,9 @@ public static class BotParser
|
|||||||
await Task.WhenAll(tasks.ToArray());
|
await Task.WhenAll(tasks.ToArray());
|
||||||
stopwatch.Stop();
|
stopwatch.Stop();
|
||||||
|
|
||||||
LoggingHelpers.LogToConsole($"Cleaned and Parsed: {parsedBotsDict.Count} bots. {totalDupeCount} dupes were ignored. Took {LoggingHelpers.LogTimeTaken(stopwatch.Elapsed.TotalSeconds)} seconds");
|
|
||||||
|
|
||||||
return [.. parsedBotsDict.Values];
|
return [.. parsedBotsDict.Values];
|
||||||
|
LoggingHelpers.LogToConsole($"Cleaned and Parsed: {parsedBotsDict.Count.ToString()} bots. {totalDupeCount.ToString()} dupes were ignored. Took {LoggingHelpers.LogTimeTaken(stopwatch.Elapsed.TotalSeconds)} seconds");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<int> ProcessBotFile(
|
private static async Task<int> ProcessBotFile(
|
||||||
@ -235,8 +235,8 @@ public static class BotParser
|
|||||||
|
|
||||||
if (jItemsToReplace != null && jItemsToReplace.Any())
|
if (jItemsToReplace != null && jItemsToReplace.Any())
|
||||||
{
|
{
|
||||||
LoggingHelpers.LogToConsole($"file {fileName} has {jItemsToReplace.Count()} json issues, cleaning up.", ConsoleColor.Yellow);
|
|
||||||
foreach (var item in jItemsToReplace)
|
foreach (var item in jItemsToReplace)
|
||||||
|
LoggingHelpers.LogToConsole($"file {fileName} has {jItemsToReplace.Count().ToString()} json issues, cleaning up.", ConsoleColor.Yellow);
|
||||||
{
|
{
|
||||||
var obj = new { x = 1, y = 0, r = 0 };
|
var obj = new { x = 1, y = 0, r = 0 };
|
||||||
item.Replace(JToken.FromObject(obj));
|
item.Replace(JToken.FromObject(obj));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user