From b4f33fe65514f1b8717f2de57f33298356430ca4 Mon Sep 17 00:00:00 2001 From: Eli Doran Date: Mon, 28 Aug 2023 14:51:20 -0400 Subject: [PATCH] Remove an unnecessary for loop in HacknetServer upgradeRam (#754) --- src/Hacknet/HacknetServer.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Hacknet/HacknetServer.ts b/src/Hacknet/HacknetServer.ts index 41ec93dba..bd71cbb53 100644 --- a/src/Hacknet/HacknetServer.ts +++ b/src/Hacknet/HacknetServer.ts @@ -104,9 +104,7 @@ export class HacknetServer extends BaseServer implements IHacknetNode { } upgradeRam(levels: number, prodMult: number): boolean { - for (let i = 0; i < levels; ++i) { - this.maxRam *= 2; - } + this.maxRam *= Math.pow(2, levels); this.maxRam = Math.min(HacknetServerConstants.MaxRam, Math.round(this.maxRam)); this.updateHashRate(prodMult);