Login  Register

The Trunk: Collections-eem.792.mcz

Posted by commits-2 on May 03, 2018; 7:56am
URL: https://forum.world.st/The-Trunk-Collections-eem-792-mcz-tp5075599.html

Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.792.mcz

==================== Summary ====================

Name: Collections-eem.792
Author: eem
Time: 3 May 2018, 12:55:52.175146 am
UUID: 7d8995ed-835e-44b0-bf4c-0b0780f5c96f
Ancestors: Collections-pre.791

Four times faster implementation of isAsciiString.

=============== Diff against Collections-pre.791 ===============

Item was changed:
  ----- Method: String>>isAsciiString (in category 'testing') -----
  isAsciiString
+ "Answer if the receiver contains only ascii characters.
+ Inline ^self allSatisfy: [ :each | each asciiValue <= 127 ] for speed."
+ 1 to: self basicSize do: [:i| (self basicAt: i) > 127 ifTrue: [^false]].
+ ^true!
-
- ^self allSatisfy: [ :each | each asciiValue <= 127 ]!