Fail early when processing (test) nodes.

If a certain segment yields no nodes the on_path() method should not process any
following segments.
This commit is contained in:
Yorick Peterse committed 2014-07-12 00:22:18 +02:00
1 parent d6aec6aa16
commit 56982dd543
2 files changed
+22

No files matched your search

+2
View File
@@ -61,6 +61,8 @@ module Oga
if test != last_node and !@stack.empty?
swap_context
elsif @stack.empty?
break
end
end
end