From: Daniel Berger Date: 2006-02-09T08:20:21+09:00 Subject: Re: [ ruby-Bugs-3506 ] Set containing duplicates noreply@rubyforge.org wrote: > Bugs item #3506, was opened at 2006-02-08 22:52 > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=1698&aid=3506&group_id=426 > > Category: Core > Group: None > Status: Open > Resolution: None > Priority: 3 > Submitted By: Stefan Rusterholz (rstefan) > Assigned to: Nobody (None) > Summary: Set containing duplicates > > Initial Comment: > If an object added to a set becomes modified and added again it will be in the set twice. > A fix to this would be to add "@hash.rehash" in "def add(o)" and "def merge(enum)". Though this might minder the speed advantage of set. > OTOH Set becomes quite useless if it is impossible to add without checking first if the element already contained. I don't see it: require "set" x = "foo" set = Set[x,"bar","baz","foo"] p set # # set.add("foo") p set # # x.chomp! set.add(x) p set ## Can anyone demonstrate the bug he is referring to? - Dan