From ed42745ff4cb47e6a882e70e9efb144ffd7ea239 Mon Sep 17 00:00:00 2001 From: Ross Healy Date: Thu, 8 Feb 2024 02:40:17 +0000 Subject: [PATCH] New & collection expression can be simplified. --- lottery-co-uk-scraper/Utilities/URLExtractor.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lottery-co-uk-scraper/Utilities/URLExtractor.cs b/lottery-co-uk-scraper/Utilities/URLExtractor.cs index 5a9a52b..9d45b21 100644 --- a/lottery-co-uk-scraper/Utilities/URLExtractor.cs +++ b/lottery-co-uk-scraper/Utilities/URLExtractor.cs @@ -6,9 +6,9 @@ namespace lottery_co_uk_scraper.Utilities { public static async Task> ExtractUrlsAsync(string url) { - List urls = new List(); + List urls = []; - using (HttpClient client = new HttpClient()) + using (HttpClient client = new()) { string content = await client.GetStringAsync(url); MatchCollection matches = MyRegex().Matches(content); @@ -24,6 +24,7 @@ namespace lottery_co_uk_scraper.Utilities } } } + urls.Reverse(); return urls; }