summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-04-24 16:14:00 -0500
committerLuke Kanies <luke@madstop.com>2009-04-24 16:27:21 -0500
commit3f7cd18604e972e78bc9182e09cc4defa46b7d8d (patch)
tree8655e62cd8de8d9742e69f6fd78f51ee214d9371
parentbf46db7452ae72d3a40ecc5cf14ae62692c47e84 (diff)
downloadpuppet-3f7cd18604e972e78bc9182e09cc4defa46b7d8d.tar.gz
puppet-3f7cd18604e972e78bc9182e09cc4defa46b7d8d.tar.xz
puppet-3f7cd18604e972e78bc9182e09cc4defa46b7d8d.zip
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 <luke@madstop.com>
-rw-r--r--lib/puppet/simple_graph.rb6
1 files 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.