Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

performance tweaks.

  • Loading branch information...
commit c1428cfbfc38f93174001fb5b40205c652db4fe3 1 parent 50ee7a6
@martinjandrews martinjandrews authored
View
7 lib/roodi/core/checking_visitor.rb
@@ -17,12 +17,7 @@ def visit(node)
checks = @checks[node.node_type]
checks.each {|check| check.evaluate_node_start(node)} unless checks.nil?
- visitable_nodes = node.is_language_node? ? node.sexp_body : node
- visitable_nodes.each do |child|
- if child.class == Sexp then
- child.accept(self)
- end
- end
+ node.visitable_children.each {|sexp| sexp.accept(self)}
checks.each {|check| check.evaluate_node_end(node)} unless checks.nil?
end
View
5 lib/roodi/core/visitable_sexp.rb
@@ -17,4 +17,9 @@ def children
def is_language_node?
first.class == Symbol
end
+
+ def visitable_children
+ parent = is_language_node? ? sexp_body : self
+ parent.children
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.