checkin from browser
authorClaus Gittinger <cg@exept.de>
Sat, 04 Oct 1997 16:29:28 +0200
changeset 2991 72c28b477ba7
parent 2990 86d7ef828d26
child 2992 197c2c222030
checkin from browser
Array.st
--- a/Array.st	Thu Oct 02 15:30:38 1997 +0200
+++ b/Array.st	Sat Oct 04 16:29:28 1997 +0200
@@ -291,19 +291,15 @@
     REGISTER OBJ cls;
 
     if (__isSmallInteger(index)) {
-	indx = __intVal(index) - 1;
-	slf = self;
+        indx = __intVal(index) - 1;
+        slf = self;
 
-	/* 
-	 * thanks to Patterson/Hennesey - this can be done with a single
-	 * compare ...
-	 */
-	nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
-	if ((cls = __qClass(slf)) != Array)
-	    indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
-	if ((unsigned)indx < (unsigned)nIndex) {
-	    RETURN ( __InstPtr(slf)->i_instvars[indx] );
-	}
+        nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
+        if ((cls = __qClass(slf)) != Array)
+            indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
+        if ((unsigned)indx < (unsigned)nIndex) {
+            RETURN ( __InstPtr(slf)->i_instvars[indx] );
+        }
     }
 %}.
     ^ super at:index
@@ -325,20 +321,17 @@
     REGISTER OBJ cls;
 
     if (__isSmallInteger(index)) {
-	indx = __intVal(index) - 1;
-	slf = self;
+        indx = __intVal(index) - 1;
+        slf = self;
 
-	/* thanks to Patterson/Hennesey - this can be done with a single
-	 * compare ...
-	 */
-	nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
-	if ((cls = __qClass(slf)) != Array)
-	    indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
-	if ((unsigned)indx < (unsigned)nIndex) {
-	    __InstPtr(slf)->i_instvars[indx] = anObject;
-	    __STORE(slf, anObject);
-	    RETURN ( anObject );
-	}
+        nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
+        if ((cls = __qClass(slf)) != Array)
+            indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
+        if ((unsigned)indx < (unsigned)nIndex) {
+            __InstPtr(slf)->i_instvars[indx] = anObject;
+            __STORE(slf, anObject);
+            RETURN ( anObject );
+        }
     }
 %}.
     ^ super at:index put:anObject
@@ -358,19 +351,15 @@
     REGISTER OBJ cls;
 
     if (__isSmallInteger(index)) {
-	indx = __intVal(index) - 1;
-	slf = self;
+        indx = __intVal(index) - 1;
+        slf = self;
 
-	/* 
-	 * thanks to Patterson/Hennesey - this can be done with a single
-	 * compare ...
-	 */
-	nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
-	if ((cls = __qClass(slf)) != Array)
-	    indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
-	if ((unsigned)indx < (unsigned)nIndex) {
-	    RETURN ( __InstPtr(slf)->i_instvars[indx] );
-	}
+        nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
+        if ((cls = __qClass(slf)) != Array)
+            indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
+        if ((unsigned)indx < (unsigned)nIndex) {
+            RETURN ( __InstPtr(slf)->i_instvars[indx] );
+        }
     }
 %}.
     ^ super basicAt:index
@@ -389,21 +378,17 @@
     REGISTER OBJ cls;
 
     if (__isSmallInteger(index)) {
-	indx = __intVal(index) - 1;
-	slf = self;
+        indx = __intVal(index) - 1;
+        slf = self;
 
-	/* 
-	 * thanks to Patterson/Hennesey - this can be done with a single
-	 * compare ...
-	 */
-	nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
-	if ((cls = __qClass(slf)) != Array)
-	    indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
-	if ((unsigned)indx < (unsigned)nIndex) {
-	    __InstPtr(slf)->i_instvars[indx] = anObject;
-	    __STORE(slf, anObject);
-	    RETURN ( anObject );
-	}
+        nIndex = __BYTES2OBJS__(__qSize(slf) - OHDR_SIZE);
+        if ((cls = __qClass(slf)) != Array)
+            indx += __intVal(__ClassInstPtr(cls)->c_ninstvars);
+        if ((unsigned)indx < (unsigned)nIndex) {
+            __InstPtr(slf)->i_instvars[indx] = anObject;
+            __STORE(slf, anObject);
+            RETURN ( anObject );
+        }
     }
 %}.
     ^ super basicAt:index put:anObject
@@ -2231,5 +2216,5 @@
 !Array class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.101 1997-09-24 02:48:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.102 1997-10-04 14:29:28 cg Exp $'
 ! !