From abc037903c7cbb26f356c82bc97b4cdb606b5e40 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 16 Jun 2020 16:49:17 +0200 Subject: [PATCH] faster github stars count --- api/networks/github.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/api/networks/github.js b/api/networks/github.js index af2da24..9d79249 100755 --- a/api/networks/github.js +++ b/api/networks/github.js @@ -25,16 +25,7 @@ export default async function fetchGitHubRepos() { } const json = await response.json() - - const numbers = [] - - json.map((item) => { - if (item.stargazers_count) { - return numbers.push(item.stargazers_count) - } - return null - }) - + const numbers = json.map((item) => item.stargazers_count) const stars = arrSum(numbers) const repositories = json.length