about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorluigi <007.lva@gmail.com>2021-01-22 10:28:15 -0500
committerGitHub <noreply@github.com>2021-01-22 16:28:15 +0100
commit7ea9588520c664f17a02265d8456b2288476cb9b (patch)
treeb8f3e17383204498ef398347f47b386d56eaa766 /app/lib
parentbc4efd5e98078946c1d62ad287361246ca571970 (diff)
Use Enumerable#filter_map in more places (#15527)
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/spam_check.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/lib/spam_check.rb b/app/lib/spam_check.rb
index 68e586d00..dcb2db9ca 100644
--- a/app/lib/spam_check.rb
+++ b/app/lib/spam_check.rb
@@ -186,9 +186,9 @@ class SpamCheck
 
   def matching_status_ids
     if nilsimsa?
-      other_digests.select { |record| record.start_with?('nilsimsa') && nilsimsa_compare_value(digest, record.split(':')[1]) >= NILSIMSA_COMPARE_THRESHOLD }.filter_map { |record| record.split(':')[2] }
+      other_digests.filter_map { |record| record.split(':')[2] if record.start_with?('nilsimsa') && nilsimsa_compare_value(digest, record.split(':')[1]) >= NILSIMSA_COMPARE_THRESHOLD }
     else
-      other_digests.select { |record| record.start_with?('md5') && record.split(':')[1] == digest }.filter_map { |record| record.split(':')[2] }
+      other_digests.filter_map { |record| record.split(':')[2] if record.start_with?('md5') && record.split(':')[1] == digest }
     end
   end