about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-10-14 21:04:57 +0200
committerGitHub <noreply@github.com>2021-10-14 21:04:57 +0200
commitb21f3aa21d0c9123c7a481dd7e87bce7d88f7045 (patch)
tree561c91e92d459fa4bcec6a25e7cf94a29376a863 /app
parent3ec8e04b3b838428cb289f6cc39fa9b4e2cf94b5 (diff)
Minor memory optimizations (#16507)
Reduce constant memory usage by ~100kB and further reduce boot-up memory
allocations and temporary memory use by a further ~200kB.
Diffstat (limited to 'app')
-rw-r--r--app/validators/reaction_validator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/validators/reaction_validator.rb b/app/validators/reaction_validator.rb
index 494b6041b..4ed3376e8 100644
--- a/app/validators/reaction_validator.rb
+++ b/app/validators/reaction_validator.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 class ReactionValidator < ActiveModel::Validator
-  SUPPORTED_EMOJIS = Oj.load(File.read(Rails.root.join('app', 'javascript', 'mastodon', 'features', 'emoji', 'emoji_map.json'))).keys.freeze
+  SUPPORTED_EMOJIS = Oj.load_file(Rails.root.join('app', 'javascript', 'mastodon', 'features', 'emoji', 'emoji_map.json').to_s).keys.freeze
 
   LIMIT = 8