Use a Set for storing void element names.

This commit is contained in:
Yorick Peterse 2014-04-10 12:28:47 +02:00
parent b96f7c4852
commit 25edd2de00
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,5 @@
require 'ast' require 'ast'
require 'set'
require_relative 'oga/ast/node' require_relative 'oga/ast/node'

View File

@ -21,9 +21,9 @@ module Oga
# Names of the HTML void elements that should be handled when HTML lexing # Names of the HTML void elements that should be handled when HTML lexing
# is enabled. # is enabled.
# #
# @return [Array] # @return [Set]
# #
HTML_VOID_ELEMENTS = [ HTML_VOID_ELEMENTS = Set.new([
'area', 'area',
'base', 'base',
'br', 'br',
@ -40,7 +40,7 @@ module Oga
'source', 'source',
'track', 'track',
'wbr' 'wbr'
] ])
# Lazy way of forwarding instance method calls used internally by Ragel # Lazy way of forwarding instance method calls used internally by Ragel
# to their corresponding class methods. # to their corresponding class methods.