I'll reply to a part that I think I understood: On Fri, 26 Jun 2009 20:39:36 +0200 Joachim Jaeckel <[email protected]> wrote:
> pads := 0. > i := 1. > > [i <= aString size] whileTrue: [ > j := i +2. > (j > aString size) ifTrue: [j := aString size]. > tripple := aString copyFrom: i to: j. > > (tripple size < 3) ifTrue: [ > pads := 3 - tripple size. > 1 to: pads do: [ :n | > tripple growBy: 1. > tripple at: (tripple size) put: (0 asCharacter). > ] > ]. Some quick reflex actions on the above part: If the string size does not change, put it into a temporary variable. j already shows if you got three characters, no need to ask tripple (triplet?) for it's size. iterate over "aString , '\0\0\0'", you'll get your padding at the end for free without extra checks gotta go now, s. You're repeatedly grabbing triplets from the string and are looking every time if you really got three characters, right? -- Stefan Schmiedl EDV-Beratung Schmiedl, Berghangstr. 5, D-93413 Cham im Büro: 09971 9966 989, am Handy: 0160 9981 6278 _______________________________________________ help-smalltalk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-smalltalk
