From b21f3aa21d0c9123c7a481dd7e87bce7d88f7045 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 14 Oct 2021 21:04:57 +0200 Subject: 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. --- app/validators/reaction_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/validators') 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 -- cgit