Merge pull request #3055 from ApamNapat/simplified_some_boolean_logic

Simplified some booleans and if elses
This commit is contained in:
hydroflame
2022-03-10 22:11:26 -05:00
committed by GitHub
10 changed files with 14 additions and 47 deletions
+2 -5
View File
@@ -806,7 +806,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
if (possibleLogs[fn] === undefined) {
throw makeRuntimeErrorMsg("isLogEnabled", `Invalid argument: ${fn}.`);
}
return workerScript.disableLogs[fn] ? false : true;
return !workerScript.disableLogs[fn];
},
getScriptLogs: function (fn: any, hostname: any, ...scriptArgs: any): any {
const runningScriptObj = getRunningScript(fn, hostname, "getScriptLogs", scriptArgs);
@@ -1589,10 +1589,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
}
}
const txtFile = getTextFile(filename, server);
if (txtFile != null) {
return true;
}
return false;
return txtFile != null;
},
isRunning: function (fn: any, hostname: any = workerScript.hostname, ...scriptArgs: any): any {
updateDynamicRam("isRunning", getRamCost(Player, "isRunning"));