Array.st
changeset 15848 e839ccbebb14
parent 15608 de5bfe8d3a42
child 16262 9bc41f1f7057
child 18113 92b4242b2b0b
--- a/Array.st	Thu Dec 05 08:47:52 2013 +0000
+++ b/Array.st	Thu Dec 05 12:34:23 2013 +0100
@@ -461,6 +461,39 @@
 
 !Array methodsFor:'copying'!
 
+, aCollection
+%{
+    if (__isArray(aCollection)) {
+        if (__isArray(self)) {
+            OBJ newArray;
+            int mySize = __arraySize(self);
+            int otherSize = __arraySize(aCollection);
+            REGISTER OBJ src;
+            int srcIdx, dstIdx;
+            newArray = __ARRAY_NEW_INT(mySize+otherSize);
+
+            src = self;
+            for (dstIdx=0; dstIdx<mySize; dstIdx++) {
+                OBJ el = __ArrayInstPtr(src)->a_element[dstIdx];
+
+                __ArrayInstPtr(newArray)->a_element[dstIdx] = el;
+                __STORE(newArray, el);
+            }
+
+            src = aCollection;
+            for (srcIdx=0; srcIdx<otherSize; srcIdx++, dstIdx++) {
+                OBJ el = __ArrayInstPtr(src)->a_element[srcIdx];
+
+                __ArrayInstPtr(newArray)->a_element[dstIdx] = el;
+                __STORE(newArray, el);
+            }
+            RETURN (newArray);
+        }
+    }
+%}.
+    ^ super , aCollection
+!
+
 copyWith:something
     "return a new collection containing the receivers elements
      and the single new element, newElement.
@@ -2579,10 +2612,10 @@
 !Array class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.160 2013-08-10 11:11:14 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.161 2013-12-05 11:34:23 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.160 2013-08-10 11:11:14 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.161 2013-12-05 11:34:23 cg Exp $'
 ! !