New & collection expression can be simplified.

This commit is contained in:
Ross Healy
2024-02-08 02:40:17 +00:00
parent ea3f91e28d
commit ed42745ff4

View File

@@ -6,9 +6,9 @@ namespace lottery_co_uk_scraper.Utilities
{ {
public static async Task<List<string>> ExtractUrlsAsync(string url) public static async Task<List<string>> ExtractUrlsAsync(string url)
{ {
List<string> urls = new List<string>(); List<string> urls = [];
using (HttpClient client = new HttpClient()) using (HttpClient client = new())
{ {
string content = await client.GetStringAsync(url); string content = await client.GetStringAsync(url);
MatchCollection matches = MyRegex().Matches(content); MatchCollection matches = MyRegex().Matches(content);
@@ -24,6 +24,7 @@ namespace lottery_co_uk_scraper.Utilities
} }
} }
} }
urls.Reverse();
return urls; return urls;
} }