diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-25 01:00:43 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-25 01:00:43 +0100 |
commit | 8cdd576927e6731cb07efc9054dee1ddf72d86b5 (patch) | |
tree | 178def672b9864595b54b350292571bfd962f1ec /src/main/java | |
parent | e70531a2090979d942b047be004b319869a6f220 (diff) | |
download | skyhanni-8cdd576927e6731cb07efc9054dee1ddf72d86b5.tar.gz skyhanni-8cdd576927e6731cb07efc9054dee1ddf72d86b5.tar.bz2 skyhanni-8cdd576927e6731cb07efc9054dee1ddf72d86b5.zip |
code cleanup
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ConfigUtils.kt | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ConfigUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ConfigUtils.kt index 99ed4b231..3d8fd5449 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ConfigUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ConfigUtils.kt @@ -40,12 +40,7 @@ object ConfigUtils { private fun <T> getEnumConstantFromLegacyId( legacyId: Int, enumClass: Class<T> - ): T? where T : Enum<T>, T : HasLegacyId { - for (enumConstant in enumClass.getEnumConstants()) { - if (enumConstant.legacyId == legacyId) return enumConstant - } - return null - } + ): T? where T : Enum<T>, T : HasLegacyId = enumClass.getEnumConstants().firstOrNull { it.legacyId == legacyId } /** * Migrates an Int to an Enum Constant. |