Skip to content

Commit 93be40a

Browse files
committed
- Removed redundant recalculation of ability's flaw status within the loop.
1 parent b3b9ca7 commit 93be40a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

MekHQ/src/mekhq/gui/campaignOptions/contents/AbilitiesTab.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ private void buildAbilityInfo(Map<String, SpecialAbility> abilities, boolean isE
216216
* @return The {@code AbilityCategory} for the specified ability.
217217
*/
218218
private AbilityCategory getCategory(SpecialAbility ability) {
219-
for (SkillPerquisite skillPerquisite : ability.getPrereqSkills()) {
220-
// Is the ability classified as a Flaw?
221-
boolean isFlaw = ability.getCost() < 0;
219+
// Is the ability classified as a Flaw?
220+
boolean isFlaw = ability.getCost() < 0;
222221

223-
if (isFlaw) {
224-
return CHARACTER_FLAW;
225-
}
222+
if (isFlaw) {
223+
return CHARACTER_FLAW;
224+
}
226225

226+
for (SkillPerquisite skillPerquisite : ability.getPrereqSkills()) {
227227
// Is the ability classified as a Combat Ability?
228228
boolean isCombatAbility = false;
229229
for (String word : new String[] { "Gunnery", "Artillery", "Small Arms" }) {

0 commit comments

Comments
 (0)