Code cleanup

This commit is contained in:
Stone_Red
2023-02-06 15:15:47 +01:00
parent 7d662dc113
commit fb21a9f492
10 changed files with 235 additions and 237 deletions
@@ -152,7 +152,7 @@ public class DownloadCommands
if (!Directory.Exists(directoryPath))
{
Directory.CreateDirectory(directoryPath);
_ = Directory.CreateDirectory(directoryPath);
}
using FileStream? fileStream = new FileStream(filePath, FileMode.Create);
@@ -72,7 +72,7 @@ public class FileCommands
string directoryPath = Path.Combine(ApiConfiguration.BasePath, "GeneratedFiles");
if (!Directory.Exists(directoryPath))
{
Directory.CreateDirectory(directoryPath);
_ = Directory.CreateDirectory(directoryPath);
}
hash = hash.Trim().ToLower();
@@ -111,7 +111,7 @@ public class FileCommands
string directoryPath = Path.Combine(ApiConfiguration.BasePath, "GeneratedFiles");
if (!Directory.Exists(directoryPath))
{
Directory.CreateDirectory(directoryPath);
_ = Directory.CreateDirectory(directoryPath);
}
hash = hash.Trim().ToLower();
@@ -72,7 +72,7 @@ public class HostCommands
string portInput = parts[1];
_ = int.TryParse(portInput, out int port);
if (port < 1000 || port >= 6000)
if (port is < 1000 or >= 6000)
{
ApiManager.SendNotificationMessageNewLine("Invalid port number!", NotificationMessageType.Error);
return;
@@ -112,7 +112,7 @@ public class HostCommands
_ = int.TryParse(portInput, out int port);
if (port < 1000 || port >= 6000)
if (port is < 1000 or >= 6000)
{
ApiManager.SendNotificationMessageNewLine("Invalid port number!", NotificationMessageType.Error);
return;