Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit b6f8652

Browse files
committed
Clean up ternary operators a bit
1 parent 7829737 commit b6f8652

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

patchwork-fml/src/main/java/net/minecraftforge/fml/common/ObfuscationReflectionHelper.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ public static String remapName(INameMappingService.Domain domain, String name) {
7777
return classDef.getName(NAMED);
7878
}
7979
} else {
80-
for (Mapped mapped : domain == INameMappingService.Domain.METHOD ? classDef.getMethods() : classDef.getFields()) {
80+
boolean domainIsMethod = domain == INameMappingService.Domain.METHOD;
81+
82+
for (Mapped mapped : domainIsMethod ? classDef.getMethods() : classDef.getFields()) {
8183
if (mapped.getName(INTERMEDIARY).equals(name)) {
8284
return mapped.getName(NAMED);
8385
}
@@ -106,8 +108,9 @@ public static String remapNameFast(INameMappingService.Domain domain, Class<?> c
106108
}
107109

108110
ClassDef classDef = MAPPINGS.getDefaultNamespaceClassMap().get(clazz.getName());
111+
boolean domainIsMethod = domain == INameMappingService.Domain.METHOD;
109112

110-
for (Mapped mapped : domain == INameMappingService.Domain.METHOD ? classDef.getMethods() : classDef.getFields()) {
113+
for (Mapped mapped : domainIsMethod ? classDef.getMethods() : classDef.getFields()) {
111114
if (mapped.getName(INTERMEDIARY).equals(name)) {
112115
return mapped.getName(NAMED);
113116
}

0 commit comments

Comments
 (0)