mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-30 09:19:40 +00:00
Small refactor: unnecessary Array.from (#3279)
## Description: Array.from was performed on this.player.alliances(), which already returns an array. Also it was saved in a const which isn't strictly necessary, same goes for the array in the loop below it. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: tryout33
This commit is contained in:
@@ -81,15 +81,13 @@ export class PlayerExecution implements Execution {
|
||||
// Record stats
|
||||
this.mg.stats().goldWork(this.player, goldFromWorkers);
|
||||
|
||||
const alliances = Array.from(this.player.alliances());
|
||||
for (const alliance of alliances) {
|
||||
for (const alliance of this.player.alliances()) {
|
||||
if (alliance.expiresAt() <= this.mg.ticks()) {
|
||||
alliance.expire();
|
||||
}
|
||||
}
|
||||
|
||||
const embargoes = this.player.getEmbargoes();
|
||||
for (const embargo of embargoes) {
|
||||
for (const embargo of this.player.getEmbargoes()) {
|
||||
if (
|
||||
embargo.isTemporary &&
|
||||
this.mg.ticks() - embargo.createdAt >
|
||||
|
||||
Reference in New Issue
Block a user