Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
CXuesong committed Aug 30, 2024
1 parent 5ae36c3 commit 445d9ac
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions WikiClientLibrary/MediaWikiUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,10 @@ private static string NavigateTo(string baseUrl, string url)
}
}
var status = (int)resp.StatusCode;
if (status == 200 || (accept400 && status >= 400 && status < 500))
if (status == 200 || (accept400 && status is >= 400 and < 500))
{
var finalUrl = resp.RequestMessage!.RequestUri!.ToString();
#if NETSTANDARD2_1
var content = await resp.Content.ReadAsStringAsync();
#else
var content = await resp.Content.ReadAsStringAsync(cancellationToken);
#endif
return (finalUrl, content);
}
return (null, null);
Expand Down

0 comments on commit 445d9ac

Please sign in to comment.