Skip to content

Commit

Permalink
Use LINQ.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetopia committed Oct 13, 2024
1 parent c93b84b commit d5737b4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Store.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ static Lazy<Uri>[] Get(this Dictionary<string, Package> source, Dictionary<strin
item.Value.Version > new Version(package.Id.Version.Major, package.Id.Version.Minor, package.Id.Version.Build, package.Id.Version.Revision))) list.Add(item.Value);
else if (item.Value.Main) return [];
}
list.Sort((x, y) => x.Main ? 1 : -1); return list.Select(_ => new Lazy<Uri>(() => new(Post(string.Format(Store._.GetExtendedUpdateInfo2, _.Id, _.Revision), true)
.LocalDescendants("Url").First(_ => _.Value.StartsWith("http://tlu.dl.delivery.mp.microsoft.com", StringComparison.Ordinal)).Value)))
.ToArray();
return list.OrderBy(_ => _.Main).Select(_ => new Lazy<Uri>(() => new(Post(string.Format(Store._.GetExtendedUpdateInfo2, _.Id, _.Revision), true)
.LocalDescendants("Url").First(_ => _.Value.StartsWith("http://tlu.dl.delivery.mp.microsoft.com", StringComparison.Ordinal)).Value))).ToArray();
}

static XElement LocalElement(this XElement source, string name) => source.Elements().Where(_ => _.Name.LocalName == name).FirstOrDefault();
Expand Down

0 comments on commit d5737b4

Please sign in to comment.