SortedCollection.st
branchjv
changeset 20079 8d884971c2ed
parent 19137 199b5e15b1da
parent 20007 fadbdacd6e66
child 20727 fb8c5591428b
--- 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
         ].
     ].