summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-06 21:55:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-06 21:55:57 +0000
commit52b9b9cb02292af1037357b4bef01ad30537d845 (patch)
treeb0dc8b667afdcbeee93edff764d76c739b78dcbc /lib
parent9f5bd0c139f1dd1e4e8734efe3f4611629ddb921 (diff)
downloadredmine-52b9b9cb02292af1037357b4bef01ad30537d845.tar.gz
redmine-52b9b9cb02292af1037357b4bef01ad30537d845.zip
Use stored ref. to array holding supported languages symbols via a constant (#26055).
Patch by Mischa The Evil. git-svn-id: http://svn.redmine.org/redmine/trunk@16624 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/syntax_highlighting.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/redmine/syntax_highlighting.rb b/lib/redmine/syntax_highlighting.rb
index 580ed6877..feff4f6b7 100644
--- a/lib/redmine/syntax_highlighting.rb
+++ b/lib/redmine/syntax_highlighting.rb
@@ -64,6 +64,8 @@ module Redmine
end
private_class_method :retrieve_supported_languages
+ SUPPORTED_LANGUAGES = retrieve_supported_languages
+
class << self
# Highlights +text+ as the content of +filename+
# Should not return line numbers nor outer pre tag
@@ -79,8 +81,7 @@ module Redmine
end
def language_supported?(language)
- supported_languages = retrieve_supported_languages
- supported_languages.include?(language.to_s.downcase.to_sym)
+ SUPPORTED_LANGUAGES.include?(language.to_s.downcase.to_sym)
rescue
false
end