diff --git a/EDEngineer/Views/ShoppingListViewModel.cs b/EDEngineer/Views/ShoppingListViewModel.cs index f2e79a24..b0274139 100644 --- a/EDEngineer/Views/ShoppingListViewModel.cs +++ b/EDEngineer/Views/ShoppingListViewModel.cs @@ -248,17 +248,12 @@ public IEnumerator GetEnumerator() yield break; } - var composition = new List(); - foreach (var i in ingredients) - { - composition.Add(new BlueprintIngredient(i.Key, i.Value)); - } - - composition = composition.OrderBy(i => i.Entry.Count - i.Size > 0 ? 1 : 0) - .ThenByDescending(i => i.Entry.Data.Subkind) - .ThenBy(i => i.Entry.Data.Kind) - .ThenBy(i => languages.Translate(i.Entry.Data.Name)) - .ToList(); + var composition = ingredients.Select(i => new BlueprintIngredient(i.Key, i.Value)) + .OrderBy(i => i.Entry.Count - i.Size > 0 ? 1 : 0) + .ThenByDescending(i => i.Entry.Data.Subkind) + .ThenBy(i => i.Entry.Data.Kind) + .ThenBy(i => languages.Translate(i.Entry.Data.Name)) + .ToList(); var metaBlueprint = new Blueprint(languages, "",