From c545642e96ea8316902da6d6872a0350c690aeec Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Mon, 15 Jul 2024 01:33:06 +0200 Subject: [PATCH] return is simple now, so we can get rid of extra val oldDecade --- .../main/java/fr/free/nrw/commons/category/CategoriesModel.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/category/CategoriesModel.kt b/app/src/main/java/fr/free/nrw/commons/category/CategoriesModel.kt index 2f87ee2ee..4e2966dc2 100644 --- a/app/src/main/java/fr/free/nrw/commons/category/CategoriesModel.kt +++ b/app/src/main/java/fr/free/nrw/commons/category/CategoriesModel.kt @@ -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)