<div dir="ltr">Is it faster even if the argument to ifAbsent: is simply "nil" instead of "[nil]"?<div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 18, 2019 at 5:13 PM <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Levente Uzonyi uploaded a new version of Collections to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Collections-ul.844.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Collections-ul.844.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-ul.844<br>
Author: ul<br>
Time: 19 July 2019, 12:08:51.94435 am<br>
UUID: df5ebfa9-4ebf-4505-8031-afd892a1061c<br>
Ancestors: Collections-mt.843<br>
<br>
- 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.<br>
<br>
=============== Diff against Collections-mt.843 ===============<br>
<br>
Item was added:<br>
+ ----- Method: String>>atOrNil: (in category 'as yet unclassified') -----<br>
+ atOrNil: anIndex<br>
+       "Return the character at anIndex or nil if the index or the argument is not valid."<br>
+ <br>
+       <primitive: 63><br>
+       ^nil!<br>
<br>
<br>
</blockquote></div>