From 7b7d2e80dc4571c00b373002ce1dcb5145d81d70 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Sat, 2 Jan 2010 11:22:12 -0600 Subject: [PATCH] More Array -> Set Make the syntax colouring run faster. --- vendor/plugins/syntax/lib/syntax/lang/ansic.rb | 4 ++-- vendor/plugins/syntax/lib/syntax/lang/javascript.rb | 4 ++-- vendor/plugins/syntax/lib/syntax/lang/ruby.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vendor/plugins/syntax/lib/syntax/lang/ansic.rb b/vendor/plugins/syntax/lib/syntax/lang/ansic.rb index 0efbb5ea..65463ccc 100644 --- a/vendor/plugins/syntax/lib/syntax/lang/ansic.rb +++ b/vendor/plugins/syntax/lib/syntax/lang/ansic.rb @@ -9,12 +9,12 @@ module Syntax end ANSIC_KEYWORDS = - %w{asm break case continue default do else for goto if return + Set.new %w{asm break case continue default do else for goto if return switch while struct union enum typedef static register auto extern sizeof volatile const inline restrict} unless const_defined?(:ANSIC_KEYWORDS) ANSIC_PREDEFINED_TYPES = - %w{int long short char void signed unsigned + Set.new %w{int long short char void signed unsigned float double bool complex} unless const_defined?(:ANSIC_PREDEFINED_TYPES) ANSIC_PREDEFINED_CONSTANTS = diff --git a/vendor/plugins/syntax/lib/syntax/lang/javascript.rb b/vendor/plugins/syntax/lib/syntax/lang/javascript.rb index ea37cf9f..5fe13241 100644 --- a/vendor/plugins/syntax/lib/syntax/lang/javascript.rb +++ b/vendor/plugins/syntax/lib/syntax/lang/javascript.rb @@ -5,7 +5,7 @@ module Syntax class Javascript < Tokenizer JAVASCRIPT_KEYWORDS = - %w{abstract break case catch class const continue + Set.new %w{abstract break case catch class const continue debugger default delete do else enum export extends final finally for function goto if implements import in instanceof interface native new @@ -15,7 +15,7 @@ module Syntax var void volatile while with} unless const_defined?(:JAVASCRIPT_KEYWORDS) JAVASCRIPT_PREDEFINED_TYPES = - %w{boolean byte char double float int long short} unless const_defined?(:JAVASCRIPT_PREDEFINED_TYPES) + Set.new %w{boolean byte char double float int long short} unless const_defined?(:JAVASCRIPT_PREDEFINED_TYPES) JAVASCRIPT_PREDEFINED_CONSTANTS = %w{null true false} unless const_defined?(:JAVASCRIPT_PREDEFINED_CONSTANTS) diff --git a/vendor/plugins/syntax/lib/syntax/lang/ruby.rb b/vendor/plugins/syntax/lib/syntax/lang/ruby.rb index 66afaa47..edccda03 100644 --- a/vendor/plugins/syntax/lib/syntax/lang/ruby.rb +++ b/vendor/plugins/syntax/lib/syntax/lang/ruby.rb @@ -9,7 +9,7 @@ module Syntax # The list of all identifiers recognized as keywords. KEYWORDS = - %w{if then elsif else end begin do rescue ensure while for + Set.new %w{if then elsif else end begin do rescue ensure while for class module def yield raise until unless and or not when case super undef break next redo retry in return alias defined?}