From ac3380b650d22ed67c0832bf2833b62aa0b390b6 Mon Sep 17 00:00:00 2001 From: Dewy Date: Sat, 9 Jan 2021 22:10:11 +0000 Subject: [PATCH] [cleanup] Simplify code: use forEachLine --- .../me/zeroeightsix/kami/module/modules/chat/LoginMessage.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/chat/LoginMessage.kt b/src/main/java/me/zeroeightsix/kami/module/modules/chat/LoginMessage.kt index bba95b413..79ebca9f9 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/chat/LoginMessage.kt +++ b/src/main/java/me/zeroeightsix/kami/module/modules/chat/LoginMessage.kt @@ -33,8 +33,8 @@ object LoginMessage : Module( if (file.exists()) { val fileReader = FileReader(file) try { - fileReader.readLines().forEach { - loginMessages.add(if (it.isNotBlank()) it.trim() else return@forEach) + fileReader.forEachLine { + loginMessages.add(if (it.isNotBlank()) it.trim() else return@forEachLine) } MessageSendHelper.sendChatMessage("$chatName Loaded ${loginMessages.size} login messages!")