# HG changeset patch # User Claus Gittinger # Date 1553711376 -3600 # Node ID da5e329759dcdf7ae18793d84fa12361d6e0280f # Parent 0e2c9990b86f4b1792968550c3bec5f52b17424f #TUNING by cg class: CharacterArray changed: #, diff -r 0e2c9990b86f -r da5e329759dc CharacterArray.st --- a/CharacterArray.st Wed Mar 27 18:42:53 2019 +0100 +++ b/CharacterArray.st Wed Mar 27 19:29:36 2019 +0100 @@ -371,7 +371,6 @@ "Modified: / 16-01-2018 / 18:59:04 / stefan" ! ! - !CharacterArray class methodsFor:'cleanup'! lowSpaceCleanup @@ -634,7 +633,6 @@ " ! ! - !CharacterArray class methodsFor:'pattern matching'! matchEscapeCharacter @@ -1042,7 +1040,6 @@ ^ Unicode32String ! ! - !CharacterArray class methodsFor:'utilities'! through:aCharacter in:inStream @@ -4303,7 +4300,7 @@ "redefined to allow characters and mixed strings to be appended. This is nonStandard, but convenient" - |myWidth otherWidth stringifiedArg| + |myWidth otherWidth stringifiedArg newString l1 l2 combinedLen| aStringOrCharacterOrAnyOther isCharacter ifTrue:[ ^ self copyWith:aStringOrCharacterOrAnyOther @@ -4314,10 +4311,17 @@ stringifiedArg := aStringOrCharacterOrAnyOther asString. stringifiedArg isString ifTrue:[ (otherWidth := stringifiedArg bitsPerCharacter) ~~ (myWidth := self bitsPerCharacter) ifTrue:[ + l1 := self size. + l2 := aStringOrCharacterOrAnyOther size. + combinedLen := l1 + l2. otherWidth > myWidth ifTrue:[ - ^ (stringifiedArg species fromString:self) , stringifiedArg + newString := stringifiedArg species uninitializedNew:combinedLen. + ] ifFalse:[ + newString := self species uninitializedNew:combinedLen. ]. - ^ self , (self species fromString:stringifiedArg) + newString replaceFrom:1 to:l1 with:self startingAt:1. + newString replaceFrom:l1+1 to:l1+l2 with:aStringOrCharacterOrAnyOther startingAt:1. + ^ newString ]. ]. ^ super , stringifiedArg @@ -4337,7 +4341,8 @@ 'hello',123,'world' allBold " - "Modified: 28.6.1997 / 00:13:17 / cg" + "Modified: / 28-06-1997 / 00:13:17 / cg" + "Modified: / 27-03-2019 / 19:28:36 / Claus Gittinger" ! ,, aString @@ -5247,8 +5252,6 @@ ! ! - - !CharacterArray methodsFor:'matching - glob expressions'! compoundMatch:aString @@ -6056,7 +6059,6 @@ ! ! - !CharacterArray methodsFor:'padded copying'! centerPaddedTo:newSize @@ -7211,7 +7213,6 @@ "Modified: 17.4.1997 / 12:50:23 / cg" ! ! - !CharacterArray methodsFor:'special string converting'! asUnixFilenameString @@ -8579,7 +8580,6 @@ " ! ! - !CharacterArray methodsFor:'substring searching'! findRangeOfString:subString @@ -9109,7 +9109,6 @@ ^ aVisitor visitString:self with:aParameter ! ! - !CharacterArray class methodsFor:'documentation'! version