diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-10-09 14:30:40 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-10-09 14:30:40 -0400 |
commit | 8dc12fd01c9274b045bafb04f02ef97fd8999c5d (patch) | |
tree | ab76933c2adab32d124b20cd81639ed212f3f625 /src/SMAPI.Web/Framework/Clients/Nexus | |
parent | 3d10d08a1ac281620b60c0e5fd1d51b2da896a0d (diff) | |
download | SMAPI-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.cs | 4 |
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; |