1
1
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:
Rob Rix 2015-09-17 14:23:51 -04:00
parent ad835e6c9a
commit d62d4a33bb

View File

@ -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 })
}