mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 23:38:35 +02:00
Refactor for ... in loops
This commit is contained in:
@@ -1484,7 +1484,7 @@ export function finishCrime(this: IPlayer, cancelled: boolean): string {
|
||||
if (determineCrimeSuccess(this, this.crimeType)) {
|
||||
//Handle Karma and crime statistics
|
||||
let crime = null;
|
||||
for (const i in Crimes) {
|
||||
for (const i of Object.keys(Crimes)) {
|
||||
if (Crimes[i].type == this.crimeType) {
|
||||
crime = Crimes[i];
|
||||
break;
|
||||
@@ -2556,15 +2556,15 @@ export function setBitNodeNumber(this: IPlayer, n: number): void {
|
||||
}
|
||||
|
||||
export function queueAugmentation(this: IPlayer, name: string): void {
|
||||
for (const i in this.queuedAugmentations) {
|
||||
if (this.queuedAugmentations[i].name == name) {
|
||||
for (const aug of this.queuedAugmentations) {
|
||||
if (aug.name == name) {
|
||||
console.warn(`tried to queue ${name} twice, this may be a bug`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (const i in this.augmentations) {
|
||||
if (this.augmentations[i].name == name) {
|
||||
for (const aug of this.augmentations) {
|
||||
if (aug.name == name) {
|
||||
console.warn(`tried to queue ${name} twice, this may be a bug`);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user