1
0
Fork 0

Codechange: Check cheap station-facility-filter before expensive in-use-filter.

pull/12317/head
Peter Nelson 2024-03-15 19:09:27 +00:00
parent d7c5e9e8ab
commit 8881703543
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 2 additions and 2 deletions

View File

@ -260,8 +260,8 @@ protected:
this->stations_per_cargo_type_no_rating = 0;
for (const Station *st : Station::Iterate()) {
if (st->owner == owner || (st->owner == OWNER_NONE && HasStationInUse(st->index, true, owner))) {
if (this->filter.facilities & st->facilities) { // only stations with selected facilities
if ((this->filter.facilities & st->facilities) != 0) { // only stations with selected facilities
if (st->owner == owner || (st->owner == OWNER_NONE && HasStationInUse(st->index, true, owner))) {
bool has_rating = false;
/* Add to the station/cargo counts. */
for (CargoID j = 0; j < NUM_CARGO; j++) {