--- a/String.st Sat Jul 09 00:57:11 2005 +0200
+++ b/String.st Mon Jul 11 15:11:27 2005 +0200
@@ -970,8 +970,18 @@
RETURN ( __mkSmallInteger(ncp - cp + 1) );
}
#else
+# ifdef __UNROLL_LOOPS__
+ for (; (index+3) <= last; index += 4) {
+ if (cp[index-1] == byteValue) { RETURN ( __mkSmallInteger(index) ); }
+ if (cp[index-1+1] == byteValue) { RETURN ( __mkSmallInteger(index+1) ); }
+ if (cp[index-1+2] == byteValue) { RETURN ( __mkSmallInteger(index+2) ); }
+ if (cp[index-1+3] == byteValue) { RETURN ( __mkSmallInteger(index+3) ); }
+ }
+# endif
for (; index <= last; index++) {
- if (*cp++ == byteValue) { RETURN ( __mkSmallInteger(index) ); }
+ if (cp[index-1] == byteValue) {
+ RETURN ( __mkSmallInteger(index) );
+ }
}
#endif
}
@@ -3422,5 +3432,5 @@
!String class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.227 2005-07-08 22:57:11 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.228 2005-07-11 13:11:27 cg Exp $'
! !