Skip to content

Commit ea84883

Browse files
committed
Merge pull request #193 from chriseidhof/use-map
Use Optional's built-in map
2 parents 3695f69 + 44b0e4f commit ea84883

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

stdlib/public/core/Map.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ public struct LazyMapGenerator<
2626
/// since the copy was made, and no preceding call to `self.next()`
2727
/// has returned `nil`.
2828
public mutating func next() -> Element? {
29-
let x = _base.next()
30-
if x != nil {
31-
return _transform(x!)
32-
}
33-
return nil
29+
return _base.next().map(_transform)
3430
}
3531

3632
public var base: Base { return _base }

0 commit comments

Comments
 (0)