Remove an unnecessary for loop in HacknetServer upgradeRam (#754)

This commit is contained in:
Eli Doran 2023-08-28 14:51:20 -04:00 committed by GitHub
parent 4b627cde1e
commit b4f33fe655
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);