0
0
Fork 0

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:
Claire 2021-10-14 21:04:57 +02:00 committed by GitHub
parent 3ec8e04b3b
commit b21f3aa21d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 18 deletions

View file

@ -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