[squeak-dev] The Inbox: Collections-ul.844.mcz

Chris Muller asqueaker at gmail.com
Thu Jul 18 22:42:49 UTC 2019


Is it faster even if the argument to ifAbsent: is simply "nil" instead of
"[nil]"?


On Thu, Jul 18, 2019 at 5:13 PM <commits at source.squeak.org> wrote:

> Levente Uzonyi uploaded a new version of Collections to project The Inbox:
> http://source.squeak.org/inbox/Collections-ul.844.mcz
>
> ==================== Summary ====================
>
> Name: Collections-ul.844
> Author: ul
> Time: 19 July 2019, 12:08:51.94435 am
> UUID: df5ebfa9-4ebf-4505-8031-afd892a1061c
> Ancestors: Collections-mt.843
>
> - added String >> #atOrNil: which uses primitive 63 and returns either the
> character at the given index or nil when the primtiive fails. This is a
> faster alternative to #at:ifAbsent: when the absent block would yield nil.
>
> =============== Diff against Collections-mt.843 ===============
>
> Item was added:
> + ----- Method: String>>atOrNil: (in category 'as yet unclassified') -----
> + atOrNil: anIndex
> +       "Return the character at anIndex or nil if the index or the
> argument is not valid."
> +
> +       <primitive: 63>
> +       ^nil!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190718/66457e5f/attachment-0001.html>


More information about the Squeak-dev mailing list