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:
VariableVince
2026-02-23 09:17:15 +00:00
committed by GitHub
parent c3a8d06cbb
commit 4788316504
+2 -4
View File
@@ -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 >