From 9cdf0596c01323ef5173124f9689fe14f095d4fb Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Wed, 23 Oct 2019 20:15:47 -0400 Subject: [PATCH] Changed similar sponsor check to check if equal as well. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index b32771b..316d1de 100644 --- a/index.js +++ b/index.js @@ -698,8 +698,8 @@ function getVoteOrganisedSponsorTimes(sponsorTimes, votes, UUIDs) { for (let i = 0; i < sponsorTimes.length; i++) { //see if the start time is located between the start and end time of the other sponsor time. - for (let j = 0; j < sponsorTimes.length; j++) { - if (sponsorTimes[j][0] > sponsorTimes[i][0] && sponsorTimes[j][0] < sponsorTimes[i][1]) { + for (let j = i + 1; j < sponsorTimes.length; j++) { + if (sponsorTimes[j][0] >= sponsorTimes[i][0] && sponsorTimes[j][0] <= sponsorTimes[i][1]) { //sponsor j is contained in sponsor i similarSponsors.push([i, j]); }