Skip to content

Commit 2f538f8

Browse files
committed
Merge pull request #568 from frootloops/enumerate-generator-count
Set default value for EnumerateGenerator.count
2 parents d864cfc + ee97757 commit 2f538f8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

stdlib/public/core/Algorithm.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,11 @@ public struct EnumerateGenerator<
164164
/// The type of element returned by `next()`.
165165
public typealias Element = (index: Int, element: Base.Element)
166166
var base: Base
167-
var count: Int
167+
var count: Int = 0
168168

169169
/// Construct from a `Base` generator.
170170
public init(_ base: Base) {
171171
self.base = base
172-
count = 0
173172
}
174173

175174
/// Advance to the next element and return it, or `nil` if no next

0 commit comments

Comments
 (0)