mirror of
https://github.com/github/semantic.git
synced 2024-11-28 01:47:01 +03:00
Inline stream costs.
This commit is contained in:
parent
17b9c0a9ec
commit
5253de2ef5
@ -8,7 +8,7 @@ public func SES<Leaf, Annotation, C: CollectionType>(a: C, _ b: C, cost: Free<Le
|
||||
if b.isEmpty { return a.map { .Delete($0) } }
|
||||
|
||||
func cons(diff: Diff, rest: Memo<Stream<(Diff, Int)>>) -> Stream<(Diff, Int)> {
|
||||
return .Cons((diff, cost(diff) + costOfStream(rest)), rest)
|
||||
return .Cons((diff, cost(diff) + (rest.value.first?.1 ?? 0)), rest)
|
||||
}
|
||||
|
||||
func costOfStream(stream: Memo<Stream<(Diff, Int)>>) -> Int {
|
||||
|
Loading…
Reference in New Issue
Block a user