Skip to content

Commit 757b0a9

Browse files
committed
sped up File Swapper by removing an await
1 parent 1cff563 commit 757b0a9

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

GPUPrefSwitcher/AppEntry.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public override readonly bool Equals(object obj)
4747
return obj is AppEntry entry &&
4848
AppPath == entry.AppPath &&
4949
AppName == entry.AppName &&
50-
//appName == entry.appName && //breaks for some reason; null comparison, perhaps?
50+
//appName == entry.appName && //breaks for some reason; null comparison with empty string... let's just exclude this since we're not using it for now
5151
EnableSwitcher == entry.EnableSwitcher &&
5252
EnableFileSwapper == entry.EnableFileSwapper &&
5353
FileSwapperPaths.SequenceEqual(entry.FileSwapperPaths) &&
@@ -63,7 +63,7 @@ public override readonly int GetHashCode()
6363
{
6464
int hashCode = -985154422;
6565
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(AppPath);
66-
//hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(appName); //for some reason this breaks the hashcode, but it's not necessary anyway
66+
//hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(appName); //see above comment for appName
6767
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(AppName);
6868
hashCode = hashCode * -1521134295 + EnableSwitcher.GetHashCode();
6969
hashCode = hashCode * -1521134295 + EnableFileSwapper.GetHashCode();

GPUPrefSwitcher/AppLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace GPUPrefSwitcher
1212
/// The Standard Log is buffered (not written immediately) by default. It is only dumped to the file upon an unhandled exception, or if live logging is set to true.
1313
/// Logs that have their file size exceed 1MB are moved into an archive folder.
1414
///
15-
/// If this class throws an unhandled exception before it successfully initializes, the Event Viewer can still help to find errors.
15+
/// If the app throws an unhandled exception before it successfully initializes, the Event Viewer can still help to find errors.
1616
/// </summary>
1717
public class AppLogger
1818
{

GPUPrefSwitcher/FileSwapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public async Task InitiateFileSwaps(PowerLineStatus forPowerLineStatus, Preferen
9999

100100
try
101101
{
102-
await InitiateSingleFileSwap(current, i);
102+
Task singleFileSwap = InitiateSingleFileSwap(current, i);
103103
}
104104
catch (AggregateException)
105105
{
@@ -305,7 +305,7 @@ private async Task InitiateSingleFileSwap(FileSwapPathTask fileSwapPathTask, int
305305
Debug.WriteLine($"Unknown power state: " + forPowerLineStatus.ToString());
306306
}
307307

308-
Logger.inst.Log($"FileSwaps Task finished for {AppEntry.AppPath}");
308+
await Logger.inst.Log($"FileSwaps Task finished for {AppEntry.AppPath}");
309309

310310
OngoingFileSwapTasks.Remove(fileSwapPathTask);
311311

Setup/Setup.vdproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -966,15 +966,15 @@
966966
{
967967
"Name" = "8:Microsoft Visual Studio"
968968
"ProductName" = "8:GPUPrefSwitcher"
969-
"ProductCode" = "8:{B4117A64-8AAD-48E8-82FF-E62211E594FA}"
970-
"PackageCode" = "8:{AC651D83-88BE-4C0C-A166-6F01E91C7BF3}"
971-
"UpgradeCode" = "8:{9E0DEB4D-3C25-4F4A-BA3D-52F0224FCC46}"
969+
"ProductCode" = "8:{7165D190-212D-43B7-8D9A-5837D45E7231}"
970+
"PackageCode" = "8:{51F0819C-D9D0-4AAD-8251-7AEBFEAAEAE8}"
971+
"UpgradeCode" = "8:{4C9420BE-E1DC-48F5-8166-8BC7B5369296}"
972972
"AspNetVersion" = "8:4.0.30319.0"
973973
"RestartWWWService" = "11:FALSE"
974974
"RemovePreviousVersions" = "11:TRUE"
975975
"DetectNewerInstalledVersion" = "11:TRUE"
976976
"InstallAllUsers" = "11:FALSE"
977-
"ProductVersion" = "8:0.1.0"
977+
"ProductVersion" = "8:0.1.1"
978978
"Manufacturer" = "8:sharpjd"
979979
"ARPHELPTELEPHONE" = "8:"
980980
"ARPHELPLINK" = "8:"

0 commit comments

Comments
 (0)