Fairly trivial, but it took me a couple of rounds of refactoring to hit
upon, so I thought I'd share it

  def collect_nodes(index, set)
    a = []
    find_nodes(index, set) {|node| a << node}
    a
  end

  def find_nodes(index, set)
    return collect_nodes(index, set) unless block_given?
    [rest of method]
  end
  
Got rid of a lot of if block_given? clutter in the second method.

martin