- def unique_nodes
- node_ids = self.nodes.collect {|node| node.id }
- if node_ids.length==0 then return [] end
- node_ids_in_other_ways = []
- way_nodes = WayNode.find(:all, :conditions => "node_id in (#{node_ids.join(',')}) and id != #{self.id}")
- node_ids_in_other_ways = way_nodes.collect {|way_node| way_node.node_id}
- return node_ids - node_ids_in_other_ways
+ def unshared_node_ids
+ node_ids = self.nodes.collect { |node| node.id }
+
+ unless node_ids.empty?
+ way_nodes = WayNode.find(:all, :conditions => "node_id in (#{node_ids.join(',')}) and id != #{self.id}")
+ node_ids = node_ids - way_nodes.collect { |way_node| way_node.node_id }
+ end
+
+ return node_ids