perf: +=5 in loop step because clearly I was stupid
This commit is contained in:
parent
597d7c8b4c
commit
944fc5ced3
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue