mirror of
https://github.com/github/semantic.git
synced 2024-11-29 11:02:26 +03:00
Use costOfStream
to implement cons
.
This commit is contained in:
parent
1ac2f8d8c0
commit
28d5612c44
@ -119,7 +119,7 @@ public enum FreeAlgorithm<A, B> {
|
||||
}
|
||||
|
||||
func cons(diff: Diff, rest: Memo<Stream<(Diff, Int)>>) -> Stream<(Diff, Int)> {
|
||||
return .Cons((diff, cost(diff) + (rest.value.first?.1 ?? 0)), rest)
|
||||
return .Cons((diff, cost(diff) + costOfStream(rest)), rest)
|
||||
}
|
||||
|
||||
func costOfStream(stream: Memo<Stream<(Diff, Int)>>) -> Int {
|
||||
|
Loading…
Reference in New Issue
Block a user