[swift-evolution] [Discussion] Updating Struct Values While Looping

Pyry Jahkola pyry.jahkola at iki.fi
Mon Mar 7 12:11:28 CST 2016


> On 07 Mar 2016, at 10:57, Paul Ossenbruggen via swift-evolution <swift-evolution at swift.org> wrote:
> 
> for i in 0..<codons.count { codons[i] = ... }

I don't disagree, but quick reminder: you might want to use `indices` instead of `..<`:

for i in codons.indices { codons[i] = ... }

— Pyry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160307/838ff927/attachment.html>


More information about the swift-evolution mailing list