From 5538daf4098b03078e7b878432c36eaa991ffc05 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Tue, 5 May 2020 09:50:15 +0200 Subject: [PATCH] tweaking a repetition rule check --- .../com/simplemobiletools/calendar/pro/helpers/Parser.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Parser.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Parser.kt index e4ee0a0e3..b9420dac7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Parser.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Parser.kt @@ -61,10 +61,9 @@ class Parser { repeatRule = if (value.startsWith("-1")) REPEAT_ORDER_WEEKDAY_USE_LAST else REPEAT_ORDER_WEEKDAY } } else if (key == BYMONTHDAY) { - val byMonthDayValueArray = value.split(",") - val intFlag = byMonthDayValueArray.find { it.toInt() == -1 } - if (intFlag != null) + if (value.split(",").any { it.toInt() == -1 }) { repeatRule = REPEAT_LAST_DAY + } } } return EventRepetition(repeatInterval, repeatRule, repeatLimit)