The Inbox: Collections-fn.869.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Collections-fn.869.mcz

commits-2
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-fn.869.mcz

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

Name: Collections-fn.869
Author: fn
Time: 3 January 2020, 10:27:08.945712 am
UUID: c29ef38b-f152-468e-bac9-74515c099ac4
Ancestors: Collections-nice.868

Add quick-check for identity to String>>sameAs: (similar to Character>>sameAs:).

Example:
[MenuIcons smallInspectItIconContents sameAs: MenuIcons smallInspectItIconContents] bench

Before:
1,740,000 per second. 574 nanoseconds per run. 0 % GC time.

After:
94,800,000 per second. 10.5 nanoseconds per run. 0 % GC time.

=============== Diff against Collections-nice.868 ===============

Item was changed:
  ----- Method: String>>sameAs: (in category 'comparing') -----
  sameAs: aString
  "Answer whether the receiver sorts equal to aString. The
  collation sequence is ascii with case differences ignored."
+ self == aString ifTrue: [ ^true ].
  ^(self compare: aString caseSensitive: false) = 2!