From 08d1cfa2aaa5c790892c004d412ca6fe33c73eb9 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Sat, 19 Dec 2015 16:51:23 +1100 Subject: [PATCH] Update EnumerateGenerator.next() for removal of ++ operator --- stdlib/public/core/Algorithm.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/public/core/Algorithm.swift b/stdlib/public/core/Algorithm.swift index a3fe61253d54a..2b8ca062737a5 100644 --- a/stdlib/public/core/Algorithm.swift +++ b/stdlib/public/core/Algorithm.swift @@ -168,7 +168,9 @@ public struct EnumerateGenerator< /// - Requires: No preceding call to `self.next()` has returned `nil`. public mutating func next() -> Element? { guard let b = base.next() else { return nil } - return (index: count++, element: b) + let element = (index: count, element: b) + count += 1 + return element } }