Skip to content

Free, open-source Windows optimization tool for performance, privacy, and simplicity.

fix(Managers): correct variable usage in optimization

itsfatduckac23cc12a8ce
diff --git a/optimizerDuck/src/Core/Managers/OptimizationManager.cs b/optimizerDuck/src/Core/Managers/OptimizationManager.cs
index c2a0c0b..df4461f 100644
--- a/optimizerDuck/src/Core/Managers/OptimizationManager.cs
+++ b/optimizerDuck/src/Core/Managers/OptimizationManager.cs
@@ -165,16 +165,15 @@ public class OptimizationManager(SystemSnapshot systemSnapshot)
.SpinnerStyle($"bold {Theme.Primary}")
.StartAsyncGlobal($"Applying [{Theme.Primary}]{selectedTweak.Name.Trim()}[/]...", async ctx =>
{
- var tweakName = selectedTweak.Name.Trim();
try
{
- SystemHelper.Title(tweakName);
- ctx.Status($"Applying [{Theme.Primary}]{tweakName}[/]...");
+ SystemHelper.Title(selectedTweak.Name);
+ ctx.Status($"Applying [{Theme.Primary}]{selectedTweak.Name}[/]...");
- using var scope = Log.BeginScope("Tweak: {TweakName}", tweakName);
+ using var scope = Log.BeginScope("Tweak: {TweakName}", selectedTweak.Name);
- Rule($"[bold white] {tweakName} [/]", Theme.Success);
- Log.LogInformation("Applying {TweakName}...", tweakName);
+ Rule($"[bold white] {selectedTweak.Name} [/]", Theme.Success);
+ Log.LogInformation("Applying {TweakName}...", selectedTweak.Name);
var stopwatch = Stopwatch.StartNew();
@@ -187,7 +186,7 @@ public class OptimizationManager(SystemSnapshot systemSnapshot)
catch (Exception e)
{
Log.LogError(e, "[{Error}]Failed to apply tweak {TweakName}[/], skipped.", Theme.Error,
- tweakName);
+ selectedTweak.Name);
}
finally
{