[cleanup] Simplify code: use forEachLine

This commit is contained in:
Dewy 2021-01-09 22:10:11 +00:00
parent 3542a12d15
commit ac3380b650
No known key found for this signature in database
GPG Key ID: 7E581A0C01213971
1 changed files with 2 additions and 2 deletions

View File

@ -33,8 +33,8 @@ object LoginMessage : Module(
if (file.exists()) { if (file.exists()) {
val fileReader = FileReader(file) val fileReader = FileReader(file)
try { try {
fileReader.readLines().forEach { fileReader.forEachLine {
loginMessages.add(if (it.isNotBlank()) it.trim() else return@forEach) loginMessages.add(if (it.isNotBlank()) it.trim() else return@forEachLine)
} }
MessageSendHelper.sendChatMessage("$chatName Loaded ${loginMessages.size} login messages!") MessageSendHelper.sendChatMessage("$chatName Loaded ${loginMessages.size} login messages!")