Codechange: Prefer EnumBitSet's All() method over bitwise comparisons. (#14611)

This makes the intent of the operation clearer.
This commit is contained in:
Peter Nelson
2025-09-12 19:37:17 +01:00
committed by dP
parent 74840d1b0a
commit 404e9bb506
3 changed files with 4 additions and 4 deletions

View File

@@ -667,7 +667,7 @@ static void MakeCzechTownName(StringBuilder &builder, uint32_t seed)
for (ending = ending_start; ending <= ending_stop; ending++) {
const CzechNameSubst *e = &_name_czech_subst_ending[ending];
if ((e->choose & choose) == choose && e->allow.Any(allow)) {
if (e->choose.All(choose) && e->allow.Any(allow)) {
map[i++] = ending;
}
}
@@ -681,7 +681,7 @@ static void MakeCzechTownName(StringBuilder &builder, uint32_t seed)
assert(gender != CZG_FREE && gender != CZG_NFREE);
}
if (do_prefix && (_name_czech_adj[prefix].choose & choose) != choose) {
if (do_prefix && !_name_czech_adj[prefix].choose.All(choose)) {
/* Throw away non-matching prefix. */
do_prefix = false;
}