<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I’m fairly confident the author of the collection has to make those checks for memory-safety, but in theory there’s wins in only doing the check <i class="">once, </i>and as early as possible. Smaller values to pass, and less checks.&nbsp;</div><div class=""><br class=""></div><div class="">This is definitely micro-micro-optimization, though. Unlikely to matter for most cases.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 18, 2016, at 6:00 PM, Max Moiseev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Yes, if the author of the collection you’re using performs the check in `removeLast`, but they don’t have to.<br class=""><br class=""><blockquote type="cite" class="">On Oct 18, 2016, at 1:28 PM, Jean-Daniel &lt;<a href="mailto:dev@xenonium.com" class="">dev@xenonium.com</a>&gt; wrote:<br class=""><br class=""><br class=""><blockquote type="cite" class="">Le 17 oct. 2016 à 23:20, Max Moiseev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; a écrit :<br class=""><br class="">Hi Louis,<br class=""><br class="">I believe, sometimes there are situations where you know for sure that your collection is not empty. Maybe you are already in the context where the check has been performed. In these cases there is no reason you’d have to pay the price of an emptiness check once again.<br class=""></blockquote><br class="">You have to pay the price anyway, as the check has to be performed to decide if the software should abort.<br class=""><br class=""><br class=""></blockquote><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></body></html>