From 944fc5ced3aa16adb3a00f6fa12c448aa5d6f76b Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Fri, 11 Aug 2023 17:15:39 +0100 Subject: [PATCH] perf: +=5 in loop step because clearly I was stupid --- src/ts/app.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ts/app.ts b/src/ts/app.ts index bcbbf71..56c7c24 100644 --- a/src/ts/app.ts +++ b/src/ts/app.ts @@ -39,7 +39,7 @@ declare const Prism: any; const authors = []; const template = Handlebars.compile(UI.blogPostTemplate.innerHTML); API.getBlogPostCount().then(async (count) => { - for (let i = 0; i < count; i++) { + for (let i = 0; i < count; i += 5) { const posts = await API.getBlogPosts(i, 5); for (const post of posts) { let author: Author; @@ -54,8 +54,6 @@ declare const Prism: any; blogPostContainer.appendChild(card); UI.updateUI(card); } - - i += 4; } document.body.appendChild(UI.createDisqusCounterScript());