Skip to content

Commit

Permalink
cosmetic refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bver committed May 4, 2012
1 parent 124b306 commit 5e9cc85
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/mutation_simplify.rb
Expand Up @@ -22,15 +22,14 @@ def mutation( parent, track )

def match( track, patterns )
track.each_with_index do |node, index|
if match_node?( node, patterns.first )
current = []
track.each { |n| current.push(n.clone) if node.from<=n.from and n.to<=node.to }
current.first.back = nil
current = reloc(current)
current.each { |n| n.back -= index unless n.back.nil? }
rejected = patterns.reject { |p| not find_node(p,current).nil? }
return current if rejected.empty?
end
next unless match_node?( node, patterns.first )
current = []
track.each { |n| current.push(n.clone) if node.from<=n.from and n.to<=node.to }
current.first.back = nil
current = reloc(current)
current.each { |n| n.back -= index unless n.back.nil? }
rejected = patterns.reject { |p| not find_node(p,current).nil? }
return current if rejected.empty?
end
[]
end
Expand Down

0 comments on commit 5e9cc85

Please sign in to comment.