improve emoji checking performance

This commit is contained in:
Nihad Abbasov 2012-10-05 07:13:21 -07:00
parent 9e4f3147a0
commit 317c928198
849 changed files with 5 additions and 1 deletions

View file

@ -128,7 +128,7 @@ module Gitlab
#
# Returns boolean
def valid_emoji?(emoji)
File.exists?(Rails.root.join('app', 'assets', 'images', 'emoji', "#{emoji}.png"))
Emoji::NAMES.include? emoji
end
# Private: Dispatches to a dedicated processing method based on reference