Skip to content

Commit

Permalink
Fixed parsing problem which won't including last meal menu of each meal.
Browse files Browse the repository at this point in the history
  • Loading branch information
EATSTEAK committed Jun 2, 2019
1 parent 1df715b commit c30bbd7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/kotlin/me/itstake/neisinfo/NeisParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
)
}
}
Expand Down

0 comments on commit c30bbd7

Please # to comment.