Refactor nesting in loadTagCounts()

pull/55/head
G1org1owo 2024-07-09 01:31:35 +02:00
parent 5ff664e725
commit cae923b68a
1 changed files with 5 additions and 6 deletions

View File

@ -313,11 +313,10 @@ async function loadTagCounts() {
// Not the best code, but it works I guess? // Not the best code, but it works I guess?
if (resp) { if (resp) {
for (let post of pop.posts) for (let post of pop.posts)
for (let tag of resp.results) for (let tag of resp.results) {
for (let postTag of post.tags) post.tags
if (tag.names.includes(postTag.name)) { .find(postTag => tag.names.includes(postTag.name))
postTag.usages = tag.usages; .usages = tag.usages;
break;
} }
} }
} }