<div dir="ltr"><div class="gmail_extra">On Sat, Dec 16, 2017 at 7:37 PM, Daniel Dunbar <span dir="ltr">&lt;<a href="mailto:daniel_dunbar@apple.com" target="_blank">daniel_dunbar@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Would you like to post a PR to fix these issues?<div><br></div><div> - Daniel</div></div></blockquote><div><br></div><div>All right, I’ve submitted a PR that I think should work, though I’m not too confident in the pre-Swift-4 parts (credit to <a href="http://swiftdoc.org">swiftdoc.org</a> if the code for old versions is valid).</div><div> </div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 16, 2017 at 8:03 PM, Saagar Jha <span dir="ltr">&lt;<a href="mailto:saagar@saagarjha.com" target="_blank">saagar@saagarjha.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class="gmail-"><blockquote type="cite"><div dir="ltr">Both of the original guard statements would be superfluous here (notably, “swapAt” is documented to have no effect when i and j are the same) so I removed them.</div></blockquote><div><br></div></span>Actually, I believe the first guard is still necessary–if the collection is empty, you’d end up with trying to construct the range 0..&lt;-1, which traps. Alternatively, stride(from:to) is more lenient.</div></div></blockquote><div><br></div><div>Right you are, not sure how I missed that. <a href="https://en.wikipedia.org/wiki/Muphry%27s_law">Muphry’s law</a> strikes again!</div><div><br></div><div>Nevin</div></div></div></div></div>