mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Mist optimization
No need to initialize assetIDs if inventory is empty. Also we know exact amount of items this way.
This commit is contained in:
@@ -149,7 +149,7 @@ namespace ArchiSteamFarm {
|
||||
ulong startAssetID = 0;
|
||||
|
||||
// We need to store asset IDs to make sure we won't get duplicate items
|
||||
HashSet<ulong> assetIDs = new();
|
||||
HashSet<ulong>? assetIDs = null;
|
||||
|
||||
while (true) {
|
||||
await ASF.InventorySemaphore.WaitAsync().ConfigureAwait(false);
|
||||
@@ -170,6 +170,8 @@ namespace ArchiSteamFarm {
|
||||
yield break;
|
||||
}
|
||||
|
||||
assetIDs ??= new HashSet<ulong>((int) response.Content.TotalInventoryCount);
|
||||
|
||||
if ((response.Content.Assets.Count == 0) || (response.Content.Descriptions.Count == 0)) {
|
||||
throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, Strings.ErrorObjectIsNull, nameof(response.Content.Assets) + " || " + nameof(response.Content.Descriptions)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user