Skip to content

Commit

Permalink
Misc optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Jan 3, 2024
1 parent 12c4b7e commit bb73916
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ArchiSteamFarm/IPC/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public void ConfigureServices(IServiceCollection services) {
knownNetworks = new HashSet<IPNetwork>();

foreach (string knownNetworkText in knownNetworksTexts) {
string[] addressParts = knownNetworkText.Split('/', StringSplitOptions.RemoveEmptyEntries);
string[] addressParts = knownNetworkText.Split('/', 3, StringSplitOptions.RemoveEmptyEntries);

if ((addressParts.Length != 2) || !IPAddress.TryParse(addressParts[0], out IPAddress? ipAddress) || !byte.TryParse(addressParts[1], out byte prefixLength)) {
ASF.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(knownNetworkText)));
Expand Down
2 changes: 1 addition & 1 deletion ArchiSteamFarm/Steam/Cards/CardsFarmer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private async Task CheckPage(IDocument htmlDocument, ISet<uint> parsedAppIDs) {
continue;
}

string[] appIDSplitted = appIDText.Split('_');
string[] appIDSplitted = appIDText.Split('_', 6);

if (appIDSplitted.Length < 5) {
Bot.ArchiLogger.LogNullError(appIDSplitted);
Expand Down
2 changes: 1 addition & 1 deletion ArchiSteamFarm/Steam/Interaction/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ internal void OnNewLicenseList() {
// There are only 7 privacy settings
const byte privacySettings = 7;

string[] privacySettingsArgs = privacySettingsText.Split(SharedInfo.ListElementSeparators, StringSplitOptions.RemoveEmptyEntries);
string[] privacySettingsArgs = privacySettingsText.Split(SharedInfo.ListElementSeparators, privacySettings + 1, StringSplitOptions.RemoveEmptyEntries);

switch (privacySettingsArgs.Length) {
case 0:
Expand Down

0 comments on commit bb73916

Please sign in to comment.