mirror of
https://github.com/github/semantic.git
synced 2024-12-26 00:12:29 +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>)? {
|
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 })
|
return analysis(ifCons: { $0 }, ifNil: { nil })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user