File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ CTQueueTest >> testEquality [
305305 q1 enqueue: ' A' ; enqueue: ' B' .
306306 q2 enqueue: ' A' ; enqueue: ' B' .
307307
308- self assert: q1 equals: q2.
308+ self assert: q1 = q2.
309309 self assert: q1 hash equals: q2 hash.
310310]
311311
Original file line number Diff line number Diff line change @@ -38,10 +38,9 @@ CTQueue class >> new: anInteger [
3838CTQueue >> = anObject [
3939
4040 self class = anObject class ifFalse: [ ^ false ].
41- self == anObject ifTrue: [ ^ true ].
4241 self size = anObject size ifFalse: [ ^ false ].
4342
44- ^ self asArray = anObject asArray
43+ ^ self elements = anObject elements
4544]
4645
4746{ #category : ' converting' }
@@ -105,6 +104,12 @@ CTQueue >> do: aBlock [
105104 ]
106105]
107106
107+ { #category : ' accessing' }
108+ CTQueue >> elements [
109+
110+ ^ elements
111+ ]
112+
108113{ #category : ' adding' }
109114CTQueue >> enqueue: anObject [
110115
@@ -161,10 +166,11 @@ CTQueue >> grow [
161166
162167{ #category : ' comparing' }
163168CTQueue >> hash [
164-
165169 | hashValue |
166- hashValue := self species hash.
167- self do: [ :each | hashValue := (hashValue + each hash) hashMultiply ].
170+ hashValue := 131 .
171+ self do: [ :each |
172+ hashValue := (hashValue + each hash) hashMultiply
173+ ].
168174 ^ hashValue
169175]
170176
You can’t perform that action at this time.
0 commit comments