diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-11-16 15:02:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 15:02:18 +0100 |
commit | 8069fd636ba14059524303ce76abe2173c4f3d01 (patch) | |
tree | 55dd4f8ecd39813080cb5ddedd834f93a7ffc919 /app/lib/formatter.rb | |
parent | 367ad2199509e9008c04c08f3476e236b27b52a1 (diff) |
Remove intermediary arrays when creating hash maps from results (#9291)
Diffstat (limited to 'app/lib/formatter.rb')
-rw-r--r-- | app/lib/formatter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index d13884ec8..05fd9eeb1 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -128,9 +128,9 @@ class Formatter return html if emojis.empty? emoji_map = if animate - emojis.map { |e| [e.shortcode, full_asset_url(e.image.url)] }.to_h + emojis.each_with_object({}) { |e, h| h[e.shortcode] = full_asset_url(e.image.url) } else - emojis.map { |e| [e.shortcode, full_asset_url(e.image.url(:static))] }.to_h + emojis.each_with_object({}) { |e, h| h[e.shortcode] = full_asset_url(e.image.url(:static)) } end i = -1 |