Misc code enhancement

This commit is contained in:
JustArchi
2016-11-29 12:16:32 +01:00
parent b7f15daa91
commit bcddffc2f2
2 changed files with 2 additions and 17 deletions

View File

@@ -1089,13 +1089,8 @@ namespace ArchiSteamFarm {
return;
}
OwnedPackageIDs.Clear();
foreach (SteamApps.LicenseListCallback.License license in callback.LicenseList) {
OwnedPackageIDs.Add(license.PackageID);
}
OwnedPackageIDs.TrimExcess();
HashSet<uint> ownedPackageIDs = new HashSet<uint>(callback.LicenseList.Select(license => license.PackageID));
OwnedPackageIDs.ReplaceIfNeededWith(ownedPackageIDs);
await Task.Delay(1000).ConfigureAwait(false); // Wait a second for eventual PlayingSessionStateCallback

View File

@@ -144,15 +144,5 @@ namespace ArchiSteamFarm {
Lock.ExitWriteLock();
}
}
internal void TrimExcess() {
Lock.EnterWriteLock();
try {
HashSet.TrimExcess();
} finally {
Lock.ExitWriteLock();
}
}
}
}