about summary refs log tree commit diff
path: root/app/services/process_hashtags_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-15 16:56:29 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-15 16:56:29 +0100
commitfdc17bea58f210f62ac0d9e836b68e84c6dbd15c (patch)
tree491613c94695ba867e81d50124e7e3eb73a0eff5 /app/services/process_hashtags_service.rb
parenta91c3ef6cef0fe5a1645c043e7d4a5ef96e82c4f (diff)
Fix rubocop issues, introduce usage of frozen literal to improve performance
Diffstat (limited to 'app/services/process_hashtags_service.rb')
-rw-r--r--app/services/process_hashtags_service.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/process_hashtags_service.rb b/app/services/process_hashtags_service.rb
index df30f73ae..3bf3471ec 100644
--- a/app/services/process_hashtags_service.rb
+++ b/app/services/process_hashtags_service.rb
@@ -1,8 +1,8 @@
+# frozen_string_literal: true
+
 class ProcessHashtagsService < BaseService
   def call(status, tags = [])
-    if status.local?
-      tags = status.text.scan(Tag::HASHTAG_RE).map(&:first)
-    end
+    tags = status.text.scan(Tag::HASHTAG_RE).map(&:first) if status.local?
 
     tags.map(&:downcase).uniq.each do |tag|
       status.tags << Tag.where(name: tag).first_or_initialize(name: tag)