From 8f3591670b61c38e0211c0d2fcdd28b86128d57b Mon Sep 17 00:00:00 2001 From: Graham Date: Wed, 29 Jan 2020 22:48:27 +0000 Subject: [PATCH] Use elvis operator in readJar() --- asm/src/main/java/dev/openrs2/asm/classpath/Library.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt b/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt index 6d1fdff4..ad105d96 100644 --- a/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt +++ b/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt @@ -150,10 +150,8 @@ class Library constructor() : Iterable { JarInputStream(Files.newInputStream(path)).use { `in` -> while (true) { - val entry = `in`.nextJarEntry - if (entry == null) { - break - } else if (!entry.name.endsWith(CLASS_SUFFIX)) { + val entry = `in`.nextJarEntry ?: break + if (!entry.name.endsWith(CLASS_SUFFIX)) { continue }