about summary refs log tree commit diff
path: root/app/lib/entity_cache.rb
diff options
context:
space:
mode:
authorpluralcafe-docker <git@plural.cafe>2018-12-02 08:24:11 +0000
committerpluralcafe-docker <git@plural.cafe>2018-12-02 08:24:11 +0000
commitae737d94ac10284738928109c11f43aeecca8a0b (patch)
treeebe739f663d259e0f2aaf2e2f2984a8d0bc9cf1e /app/lib/entity_cache.rb
parent384a602fd4117a73338542c59985f54acf5fb3f8 (diff)
parent4b85bf12ab7005a5a6b4472b8aeaf022ce042ad7 (diff)
Merge branch 'glitch'
Diffstat (limited to 'app/lib/entity_cache.rb')
-rw-r--r--app/lib/entity_cache.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/entity_cache.rb b/app/lib/entity_cache.rb
index 2aa37389c..8fff544a0 100644
--- a/app/lib/entity_cache.rb
+++ b/app/lib/entity_cache.rb
@@ -21,7 +21,7 @@ class EntityCache
     end
 
     unless uncached_ids.empty?
-      uncached = CustomEmoji.where(shortcode: shortcodes, domain: domain, disabled: false).map { |item| [item.shortcode, item] }.to_h
+      uncached = CustomEmoji.where(shortcode: shortcodes, domain: domain, disabled: false).each_with_object({}) { |item, h| h[item.shortcode] = item }
       uncached.each_value { |item| Rails.cache.write(to_key(:emoji, item.shortcode, domain), item, expires_in: MAX_EXPIRATION) }
     end