Use string interpolation wherever possible

Majority of cases still need to go through string.Format() due to localization requirements
This commit is contained in:
Archi
2021-09-27 19:59:00 +02:00
parent de19010820
commit f2d3a2a894
29 changed files with 160 additions and 160 deletions

View File

@@ -43,7 +43,7 @@ namespace ArchiSteamFarm.CustomPlugins.PeriodicGC {
public void OnLoaded() {
TimeSpan timeSpan = TimeSpan.FromSeconds(GCPeriod);
ASF.ArchiLogger.LogGenericWarning("Periodic GC will occur every " + timeSpan.ToHumanReadable() + ". Please keep in mind that this plugin should be used for debugging tests only.");
ASF.ArchiLogger.LogGenericWarning($"Periodic GC will occur every {timeSpan.ToHumanReadable()}. Please keep in mind that this plugin should be used for debugging tests only.");
lock (LockObject) {
PeriodicGCTimer.Change(timeSpan, timeSpan);
@@ -51,14 +51,14 @@ namespace ArchiSteamFarm.CustomPlugins.PeriodicGC {
}
private static void PerformGC(object? state = null) {
ASF.ArchiLogger.LogGenericWarning("Performing GC, current memory: " + (GC.GetTotalMemory(false) / 1024) + " KB.");
ASF.ArchiLogger.LogGenericWarning($"Performing GC, current memory: {GC.GetTotalMemory(false) / 1024} KB.");
lock (LockObject) {
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true);
}
ASF.ArchiLogger.LogGenericWarning("GC finished, current memory: " + (GC.GetTotalMemory(false) / 1024) + " KB.");
ASF.ArchiLogger.LogGenericWarning($"GC finished, current memory: {GC.GetTotalMemory(false) / 1024} KB.");
}
}
}