From c30bbd71f7a6f79c8ec5aed45443a109bad2933f Mon Sep 17 00:00:00 2001 From: ITSTAKE Date: Sun, 2 Jun 2019 23:53:46 +0900 Subject: [PATCH] Fixed parsing problem which won't including last meal menu of each meal. --- src/main/kotlin/me/itstake/neisinfo/NeisParser.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/me/itstake/neisinfo/NeisParser.kt b/src/main/kotlin/me/itstake/neisinfo/NeisParser.kt index 8b237fb..51f6ba7 100644 --- a/src/main/kotlin/me/itstake/neisinfo/NeisParser.kt +++ b/src/main/kotlin/me/itstake/neisinfo/NeisParser.kt @@ -3,10 +3,6 @@ package me.itstake.neisinfo import java.io.StringWriter import java.util.HashMap import kotlin.collections.ArrayList -import kotlin.collections.List -import kotlin.collections.Map -import kotlin.collections.forEach -import kotlin.collections.hashMapOf import kotlin.collections.set @@ -90,16 +86,16 @@ class NeisParser { if (breakfastIndex > -1) toMealArray( td.subList( breakfastIndex + 1, - if (lunchIndex > -1) lunchIndex - 1 else td.size - 1 + if (lunchIndex > -1) lunchIndex else td.size ) ) else null, if (lunchIndex > -1) toMealArray( td.subList( lunchIndex + 1, - if (dinnerIndex > -1) dinnerIndex - 1 else td.size - 1 + if (dinnerIndex > -1) dinnerIndex else td.size ) ) else null, - if (dinnerIndex > -1) toMealArray(td.subList(dinnerIndex + 1, td.size - 1)) else null + if (dinnerIndex > -1) toMealArray(td.subList(dinnerIndex + 1, td.size)) else null ) } }