--- a/SortedCollection.st Thu Jun 30 21:11:02 2016 +0100
+++ b/SortedCollection.st Thu Jun 30 21:12:35 2016 +0100
@@ -389,10 +389,7 @@
"add all elements of the argument, aCollection to the receiver.
Returns the argument, aCollection (sigh)."
- |addedCollection mySize numAdded|
-
- numAdded := aCollection size.
- mySize := self size.
+ |addedCollection|
(aCollection isSortedCollection
and:[aCollection sortBlock == sortBlock]) ifTrue:[
@@ -401,11 +398,11 @@
addedCollection := Array withAll:aCollection.
addedCollection stableSort:sortBlock.
- mySize == 0 ifTrue:[
+ self size == 0 ifTrue:[
"/ special case: I am empty - add them en-bloque.
contentsArray := addedCollection.
firstIndex := 1.
- lastIndex := numAdded.
+ lastIndex := aCollection size.
^ aCollection
].
].