Skip to content

Commit

Permalink
anyone can consume an invalid data gap. and data gaps aren't allowed …
Browse files Browse the repository at this point in the history
…to take part in bridge merges except when they're the betweener
  • Loading branch information
sobri909 committed Jun 3, 2018
1 parent 4f71789 commit 7b7998c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions LocoKit/Base/Timelines/MergeScores.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class MergeScores {
// data gaps can only consume data gaps
if consumer.isDataGap { return consumee.isDataGap ? .perfect : .impossible }

// no one except data gaps can consume data gaps
if consumee.isDataGap { return .impossible }
// anyone can consume an invalid data gap, but no one can consume a valid data gap
if consumee.isDataGap { return consumee.isInvalid ? .medium : .impossible }

// nolos can only consume nolos
if consumer.isNolo { return consumee.isNolo ? .perfect : .impossible }
Expand Down
4 changes: 2 additions & 2 deletions LocoKit/Base/Timelines/TimelineProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class TimelineProcessor {

// if next has a lesser keepness, look at doing a merge against next-next
if !workingItem.isDataGap, next.keepnessScore < workingItem.keepnessScore {
if let nextNext = next.nextItem, nextNext.keepnessScore > next.keepnessScore {
if let nextNext = next.nextItem, !nextNext.isDataGap, nextNext.keepnessScore > next.keepnessScore {
nextNext.sanitiseEdges()

merges.insert(Merge(keeper: workingItem, betweener: next, deadman: nextNext))
Expand All @@ -82,7 +82,7 @@ public class TimelineProcessor {

// if previous has a lesser keepness, look at doing a merge against previous-previous
if !workingItem.isDataGap, previous.keepnessScore < workingItem.keepnessScore {
if let prevPrev = previous.previousItem, prevPrev.keepnessScore > previous.keepnessScore {
if let prevPrev = previous.previousItem, !prevPrev.isDataGap, prevPrev.keepnessScore > previous.keepnessScore {
prevPrev.sanitiseEdges()

merges.insert(Merge(keeper: workingItem, betweener: previous, deadman: prevPrev))
Expand Down

0 comments on commit 7b7998c

Please sign in to comment.