mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Misc code enhancement
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -144,15 +144,5 @@ namespace ArchiSteamFarm {
|
||||
Lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
internal void TrimExcess() {
|
||||
Lock.EnterWriteLock();
|
||||
|
||||
try {
|
||||
HashSet.TrimExcess();
|
||||
} finally {
|
||||
Lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user