mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-24 10:12:53 +02:00
Refactor for ... in loops
This commit is contained in:
@@ -46,25 +46,25 @@ export function Companies(): React.ReactElement {
|
||||
}
|
||||
|
||||
function tonsOfRepCompanies(): void {
|
||||
for (const c in AllCompanies) {
|
||||
for (const c of Object.keys(AllCompanies)) {
|
||||
AllCompanies[c].playerReputation = bigNumber;
|
||||
}
|
||||
}
|
||||
|
||||
function resetAllRepCompanies(): void {
|
||||
for (const c in AllCompanies) {
|
||||
for (const c of Object.keys(AllCompanies)) {
|
||||
AllCompanies[c].playerReputation = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function tonsOfFavorCompanies(): void {
|
||||
for (const c in AllCompanies) {
|
||||
for (const c of Object.keys(AllCompanies)) {
|
||||
AllCompanies[c].favor = bigNumber;
|
||||
}
|
||||
}
|
||||
|
||||
function resetAllFavorCompanies(): void {
|
||||
for (const c in AllCompanies) {
|
||||
for (const c of Object.keys(AllCompanies)) {
|
||||
AllCompanies[c].favor = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export function Factions(props: IProps): React.ReactElement {
|
||||
}
|
||||
|
||||
function receiveAllInvites(): void {
|
||||
for (const i in AllFaction) {
|
||||
for (const i of Object.keys(AllFaction)) {
|
||||
props.player.receiveInvite(AllFaction[i].name);
|
||||
}
|
||||
}
|
||||
@@ -74,25 +74,25 @@ export function Factions(props: IProps): React.ReactElement {
|
||||
}
|
||||
|
||||
function tonsOfRep(): void {
|
||||
for (const i in AllFaction) {
|
||||
for (const i of Object.keys(AllFaction)) {
|
||||
AllFaction[i].playerReputation = bigNumber;
|
||||
}
|
||||
}
|
||||
|
||||
function resetAllRep(): void {
|
||||
for (const i in AllFaction) {
|
||||
for (const i of Object.keys(AllFaction)) {
|
||||
AllFaction[i].playerReputation = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function tonsOfFactionFavor(): void {
|
||||
for (const i in AllFaction) {
|
||||
for (const i of Object.keys(AllFaction)) {
|
||||
AllFaction[i].favor = bigNumber;
|
||||
}
|
||||
}
|
||||
|
||||
function resetAllFactionFavor(): void {
|
||||
for (const i in AllFaction) {
|
||||
for (const i of Object.keys(AllFaction)) {
|
||||
AllFaction[i].favor = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export function Programs(props: IProps): React.ReactElement {
|
||||
}
|
||||
|
||||
function addAllPrograms(): void {
|
||||
for (const i in AllPrograms) {
|
||||
for (const i of Object.keys(AllPrograms)) {
|
||||
if (!props.player.hasProgram(AllPrograms[i].name)) {
|
||||
props.player.getHomeComputer().programs.push(AllPrograms[i].name);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export function StockMarket(): React.ReactElement {
|
||||
};
|
||||
}
|
||||
|
||||
for (const name in SM) {
|
||||
for (const name of Object.keys(SM)) {
|
||||
if (SM.hasOwnProperty(name)) {
|
||||
const stock = SM[name];
|
||||
if (stock instanceof Stock && match(stock.symbol)) {
|
||||
|
||||
Reference in New Issue
Block a user