[swift-evolution] Removing enumerated?

Dave Abrahams dabrahams at apple.com
Mon Feb 6 16:29:31 CST 2017


on Sun Feb 05 2017, Patrick Pijnappel <swift-evolution at swift.org> wrote:

> Note that zip(a.indices, a) requires advancing the index twice each
> iteration, which for non-array collections is not necessarily super
> trivial. Considering we're talking about such a low-level operation as
> iterating through a collection this might be worth considering.

If you're worried about this, there's a really easy solution: write your
loop over a.indices and the subscript a using those indices to get the
element.

> Personally I'm in favor of adding indexed().

As mentioned earlier in the thread, I'm strongly opposed to adding it at
this time.

-- 
-Dave



More information about the swift-evolution mailing list