Treat segments where end time of one equals start time of the other as not overlapping

This commit is contained in:
Ajay Ramachandran
2021-09-02 13:07:49 -04:00
parent 9cbea88f6f
commit 2a284d7f25

View File

@@ -218,7 +218,7 @@ async function chooseSegments(segments: DBSegment[], max: number): Promise<DBSeg
let currentGroup: OverlappingSegmentGroup; let currentGroup: OverlappingSegmentGroup;
let cursor = -1; //-1 to make sure that, even if the 1st segment starts at 0, a new group is created let cursor = -1; //-1 to make sure that, even if the 1st segment starts at 0, a new group is created
for (const segment of segments) { for (const segment of segments) {
if (segment.startTime > cursor) { if (segment.startTime >= cursor) {
currentGroup = {segments: [], votes: 0, reputation: 0, locked: false, required: false}; currentGroup = {segments: [], votes: 0, reputation: 0, locked: false, required: false};
overlappingSegmentsGroups.push(currentGroup); overlappingSegmentsGroups.push(currentGroup);
} }