--- a/String.st Mon Nov 21 17:39:12 1994 +0100
+++ b/String.st Mon Nov 21 17:39:21 1994 +0100
@@ -21,7 +21,7 @@
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/String.st,v 1.20 1994-11-17 14:18:10 claus Exp $
+$Header: /cvs/stx/stx/libbasic/String.st,v 1.21 1994-11-21 16:39:21 claus Exp $
'!
!String class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
version
"
-$Header: /cvs/stx/stx/libbasic/String.st,v 1.20 1994-11-17 14:18:10 claus Exp $
+$Header: /cvs/stx/stx/libbasic/String.st,v 1.21 1994-11-21 16:39:21 claus Exp $
"
!
@@ -1204,7 +1204,7 @@
* refetch in case of a GC
*/
cp1 = (char *) _stringVal(self);
- cp2 = (char *) _stringVal(s);
+ cp2 = (char *) _stringVal(aString);
#ifdef FAST_MEMCPY
bcopy(cp1, dstp, l1);
bcopy(cp2, dstp + l1, l2+1);
@@ -1436,11 +1436,16 @@
bcopy(_stringVal(self) + index1 - 1, dstp, count);
dstp[count] = '\0';
#else
+# ifdef FAST_STRCPY
+ strncpy(dstp, _stringVal(self) + index1 - 1, count);
+ dstp[count] = '\0';
+# else
srcp = _stringVal(self) + index1 - 1;
while (count--) {
*dstp++ = *srcp++;
}
*dstp = '\0';
+# endif
#endif
RETURN ( newString );
}
@@ -1492,11 +1497,16 @@
bcopy(_stringVal(self) + index1 - 1, dstp, count);
dstp[count] = '\0';
#else
+# ifdef FAST_STRCPY
+ strncpy(dstp, _stringVal(self) + index1 - 1, count);
+ dstp[count] = '\0';
+# else
srcp = _stringVal(self) + index1 - 1;
while (count--) {
*dstp++ = *srcp++;
}
*dstp = '\0';
+# endif
#endif
RETURN ( newString );
}
@@ -1628,7 +1638,7 @@
!
atAllPut:aCharacter
- "replace all characters with aCharacter
+ "replace all elements with aCharacter
- reimplemented here for speed"
%{ /* NOCONTEXT */