From 3f7cd18604e972e78bc9182e09cc4defa46b7d8d Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 24 Apr 2009 16:14:00 -0500 Subject: Reverting part of the switch to sets in SimpleGraph Unfortunately, again because of a Ruby bug (http://rubyforge.org/tracker/?group_id=426&atid=1698&func=detail&aid=8886) Ruby can't print yaml that it can read, if custom classes are used as keys in hashes, which Sets use internally. Signed-off-by: Luke Kanies --- lib/puppet/simple_graph.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb index 05420eab9..97098325b 100644 --- a/lib/puppet/simple_graph.rb +++ b/lib/puppet/simple_graph.rb @@ -102,7 +102,7 @@ class Puppet::SimpleGraph def initialize @vertices = {} - @edges = Set.new + @edges = [] end # Clear our graph. @@ -226,7 +226,7 @@ class Puppet::SimpleGraph def remove_vertex!(vertex) return nil unless vertex?(vertex) @vertices[vertex].edges.each { |edge| remove_edge!(edge) } - @edges.subtract(@vertices[vertex].edges) + @edges -= @vertices[vertex].edges @vertices[vertex].clear @vertices.delete(vertex) end @@ -276,7 +276,7 @@ class Puppet::SimpleGraph end def edges - @edges.to_a + @edges.dup end # Remove an edge from our graph. -- cgit