perf: +=5 in loop step because clearly I was stupid

This commit is contained in:
Oliver Booth 2023-08-11 17:15:39 +01:00
parent 597d7c8b4c
commit 944fc5ced3
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
1 changed files with 1 additions and 3 deletions

View File

@ -39,7 +39,7 @@ declare const Prism: any;
const authors = []; const authors = [];
const template = Handlebars.compile(UI.blogPostTemplate.innerHTML); const template = Handlebars.compile(UI.blogPostTemplate.innerHTML);
API.getBlogPostCount().then(async (count) => { 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); const posts = await API.getBlogPosts(i, 5);
for (const post of posts) { for (const post of posts) {
let author: Author; let author: Author;
@ -54,8 +54,6 @@ declare const Prism: any;
blogPostContainer.appendChild(card); blogPostContainer.appendChild(card);
UI.updateUI(card); UI.updateUI(card);
} }
i += 4;
} }
document.body.appendChild(UI.createDisqusCounterScript()); document.body.appendChild(UI.createDisqusCounterScript());