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.
This commit is contained in:
parent
3ec8e04b3b
commit
b21f3aa21d
2 changed files with 15 additions and 18 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue