return is simple now, so we can get rid of extra val oldDecade

This commit is contained in:
Matija Nalis 2024-07-15 01:33:06 +02:00
parent e3c1923036
commit c545642e96

View file

@ -42,7 +42,6 @@ class CategoriesModel @Inject constructor(
val mentionsDecade = item.matches(".*0s.*".toRegex())
val recentDecade = item.matches(".*20[0-2]0s.*".toRegex())
val oldDecade = !recentDecade
val spammyCategory = item.matches("(.*)needing(.*)".toRegex())
|| item.matches("(.*)taken on(.*)".toRegex())
@ -53,7 +52,7 @@ class CategoriesModel @Inject constructor(
if (mentionsDecade) {
//Check if the year in the form of XX(X)0s is recent/relevant, i.e. in the 2000s or 2010s/2020s as stated in Issue #1029
return oldDecade
return !recentDecade
} else {
// If it is not an year in 20xxs form, then check if item contains a 4-digit word
// anywhere within the string (.* is wildcard) (Issue #47)