From 09813033914aa4babd8f4e18ec39166336162ea7 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 10 Jan 2021 22:19:31 +0000 Subject: [PATCH] Replace if/else sequence with when Signed-off-by: Graham --- .../patcher/transform/HighDpiTransformer.kt | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/patcher/src/main/kotlin/org/openrs2/patcher/transform/HighDpiTransformer.kt b/patcher/src/main/kotlin/org/openrs2/patcher/transform/HighDpiTransformer.kt index 61b4c721fc..4bd9b364e3 100644 --- a/patcher/src/main/kotlin/org/openrs2/patcher/transform/HighDpiTransformer.kt +++ b/patcher/src/main/kotlin/org/openrs2/patcher/transform/HighDpiTransformer.kt @@ -58,15 +58,19 @@ public class HighDpiTransformer : Transformer() { return false } - if (clazz.name == gameShell) { - addCanvasScaleField(clazz) - newMembers++ - } else if (clazz.name in GL_INTERFACES) { - addPixelZoomMethod(clazz, Opcodes.ACC_ABSTRACT) - newMembers++ - } else if (clazz.name in GL_IMPLS) { - addPixelZoomMethod(clazz, Opcodes.ACC_FINAL or Opcodes.ACC_NATIVE) - newMembers++ + when (clazz.name) { + gameShell -> { + addCanvasScaleField(clazz) + newMembers++ + } + in GL_INTERFACES -> { + addPixelZoomMethod(clazz, Opcodes.ACC_ABSTRACT) + newMembers++ + } + in GL_IMPLS -> { + addPixelZoomMethod(clazz, Opcodes.ACC_FINAL or Opcodes.ACC_NATIVE) + newMembers++ + } } return false