String.st
branchjv
changeset 18470 9e4db770f8f5
parent 18407 911d6c93d78a
child 18487 8735bd9eee2f
--- a/String.st	Wed Jun 03 06:50:11 2015 +0200
+++ b/String.st	Wed Jun 03 21:55:34 2015 +0100
@@ -572,13 +572,16 @@
 	slf = self;
 	cls = __qClass(slf);
 	indx = __intVal(index) - 1;
-	if (cls != String) {
-	    if (indx < 0) goto badIndex;
-	    indx += __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-	}
-	if ((unsigned)indx < (unsigned)(__stringSize(slf))) {
-	    RETURN ( __MKCHARACTER(__stringVal(slf)[indx] & 0xFF) );
-	}
+	if (cls == String) {
+	    fetch:
+	    if ((unsigned)indx < (unsigned)(__stringSize(slf))) {
+	        RETURN ( __MKCHARACTER(__stringVal(slf)[indx] & 0xFF) );
+	    }	    
+	   goto badIndex;
+        }
+	if (indx < 0) goto badIndex;
+	indx += __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+	goto fetch;
     }
 badIndex: ;
 #endif /* ! __SCHTEAM__ */