mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 00:20:50 +00:00
Code review according to Jeffrey Richter
> The pattern is to take the basest class or interface possible for your arguments and return the most specific class or interface possible for your return types. This gives your callers the most flexibility in passing in types to your methods and the most opportunities to cast/reuse the return values.
This commit is contained in:
@@ -175,7 +175,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task Init(string[] args) {
|
||||
private static async Task Init(IReadOnlyCollection<string> args) {
|
||||
AppDomain.CurrentDomain.ProcessExit += OnProcessExit;
|
||||
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
|
||||
TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;
|
||||
@@ -187,7 +187,7 @@ namespace ArchiSteamFarm {
|
||||
await InitASF(args).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private static async Task InitASF(string[] args) {
|
||||
private static async Task InitASF(IReadOnlyCollection<string> args) {
|
||||
ASF.ArchiLogger.LogGenericInfo("ASF V" + SharedInfo.Version + " (" + SharedInfo.ModuleVersion + ")");
|
||||
|
||||
await InitGlobalConfigAndLanguage().ConfigureAwait(false);
|
||||
@@ -223,7 +223,7 @@ namespace ArchiSteamFarm {
|
||||
ASF.InitEvents();
|
||||
}
|
||||
|
||||
private static void InitCore(string[] args) {
|
||||
private static void InitCore(IReadOnlyCollection<string> args) {
|
||||
string homeDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
if (!string.IsNullOrEmpty(homeDirectory)) {
|
||||
Directory.SetCurrentDirectory(homeDirectory);
|
||||
@@ -405,7 +405,7 @@ namespace ArchiSteamFarm {
|
||||
e.SetObserved();
|
||||
}
|
||||
|
||||
private static void ParsePostInitArgs(IEnumerable<string> args) {
|
||||
private static void ParsePostInitArgs(IReadOnlyCollection<string> args) {
|
||||
if (args == null) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(args));
|
||||
return;
|
||||
@@ -461,7 +461,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
private static void ParsePreInitArgs(IEnumerable<string> args) {
|
||||
private static void ParsePreInitArgs(IReadOnlyCollection<string> args) {
|
||||
if (args == null) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(args));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user