mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
Don’t switch in uncons.
This commit is contained in:
parent
ad835e6c9a
commit
d62d4a33bb
@ -24,12 +24,6 @@ public enum Stream<A>: NilLiteralConvertible, SequenceType {
|
||||
}
|
||||
|
||||
public var uncons: (first: A, rest: Memo<Stream>)? {
|
||||
switch self {
|
||||
case let .Cons(first, rest):
|
||||
return (first, rest.value)
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
return analysis(ifCons: { $0 }, ifNil: { nil })
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user