Set.st
changeset 14134 72811a1ed607
parent 14019 9b08cdb0db50
child 14300 5b7ebcd0d2e0
--- a/Set.st	Mon May 14 13:02:49 2012 +0200
+++ b/Set.st	Mon May 14 13:14:52 2012 +0200
@@ -530,14 +530,6 @@
     "Modified: 30.1.1997 / 14:58:08 / cg"
 ! !
 
-!Set methodsFor:'binary storage'!
-
-readBinaryContentsFrom: stream manager: manager
-    "must rehash after reload"
-
-    super readBinaryContentsFrom: stream manager: manager.
-    self rehash
-! !
 
 !Set methodsFor:'comparing'!
 
@@ -545,11 +537,12 @@
     "return true, if the argument is a Set containing the same elements
      as I do"
 
-    aCollection species == self species ifFalse:[^ false].
-    aCollection size == self size ifFalse:[^ false].
+    aCollection species ~~ self species ifTrue:[^ false].
+    aCollection size ~~ self size ifTrue:[^ false].
     "/ same number of elements; since I am a Set, all of
     "/ of my elements must be in the other collection ...
-    ^ self conform:[:element | (aCollection includes:element)]
+    self do:[:eachElement | (aCollection includes:eachElement) ifFalse:[^ false]].
+    ^ true.
 
     "
      #(1 2 3 4 5) asSet = #(2 3 4 5 1) asSet
@@ -608,17 +601,17 @@
      time can become much bigger than the time lost in added probing.
      Time will show ...
      Notice & warning:
-	if the #= method is ever changed to compare non-dictionaries equal,
-	the code below must be changed to assert that the same hash-value is 
-	still returned.
-	(which may be hard to acomplish)
+        if the #= method is ever changed to compare non-dictionaries equal,
+        the code below must be changed to assert that the same hash-value is 
+        still returned.
+        (which may be hard to acomplish)
     "
 
     |mySize|
 
     mySize := self size.
     mySize == 0 ifTrue:[^ 0].
-    ^ ((self first) hash times:mySize) bitAnd:16r3FFFFFFF
+    ^ (self anElement hash times:mySize) bitAnd:16r3FFFFFFF
 
     "
      |d|
@@ -641,10 +634,6 @@
      d at:'two' put:2.
      d hash     
     "
-
-
-
-
 ! !
 
 !Set methodsFor:'copying'!
@@ -677,14 +666,6 @@
     "Modified: 1.3.1996 / 21:41:13 / cg"
 ! !
 
-!Set methodsFor:'inspecting'!
-
-inspectorClass
-    "redefined to use SetInspector
-     (instead of the default Inspector)."
-
-    ^ SetInspectorView
-! !
 
 !Set methodsFor:'obsolete set operations'!
 
@@ -1202,11 +1183,11 @@
 !Set class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.110 2012-02-22 12:55:54 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.111 2012-05-14 11:14:52 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.110 2012-02-22 12:55:54 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.111 2012-05-14 11:14:52 stefan Exp $'
 ! !
 
 Set initialize!