summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Clients/Nexus
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-10-09 14:30:40 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-10-09 14:30:40 -0400
commit8dc12fd01c9274b045bafb04f02ef97fd8999c5d (patch)
treeab76933c2adab32d124b20cd81639ed212f3f625 /src/SMAPI.Web/Framework/Clients/Nexus
parent3d10d08a1ac281620b60c0e5fd1d51b2da896a0d (diff)
downloadSMAPI-8dc12fd01c9274b045bafb04f02ef97fd8999c5d.tar.gz
SMAPI-8dc12fd01c9274b045bafb04f02ef97fd8999c5d.tar.bz2
SMAPI-8dc12fd01c9274b045bafb04f02ef97fd8999c5d.zip
optimize string splits
Diffstat (limited to 'src/SMAPI.Web/Framework/Clients/Nexus')
-rw-r--r--src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs b/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs
index 23b25f95..46c3092c 100644
--- a/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs
+++ b/src/SMAPI.Web/Framework/Clients/Nexus/NexusClient.cs
@@ -121,10 +121,10 @@ namespace StardewModdingAPI.Web.Framework.Clients.Nexus
HtmlNode? node = doc.DocumentNode.SelectSingleNode("//div[contains(@class, 'site-notice')][contains(@class, 'warning')]");
if (node != null)
{
- string[] errorParts = node.InnerText.Trim().Split(new[] { '\n' }, 2, System.StringSplitOptions.RemoveEmptyEntries);
+ string[] errorParts = node.InnerText.Trim().Split('\n', 2, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
string errorCode = errorParts[0];
string? errorText = errorParts.Length > 1 ? errorParts[1] : null;
- switch (errorCode.Trim().ToLower())
+ switch (errorCode.ToLower())
{
case "not found":
return null;