From fac4c47066dd05eca400285bc0b7d6e1cd099cf4 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 30 Apr 2020 13:16:52 -0500 Subject: [PATCH] Update contributors short-circuit logic Co-authored-by: rex.tsou --- js/contributors.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/contributors.js b/js/contributors.js index 24ebd43..28039c5 100644 --- a/js/contributors.js +++ b/js/contributors.js @@ -19,6 +19,8 @@ function getContributors(page) { } }); container.append(contributorList.join('')); + // If the length of the data is < 100, we know we are processing the last page of data. + if (data.length < 100) return; getContributors(page + 1); }); }