slight refactor
This commit is contained in:
parent
204c02f219
commit
010b590d3f
1 changed files with 5 additions and 6 deletions
|
@ -199,12 +199,11 @@ function setup() {
|
|||
itemsByYear = new Map;
|
||||
for (const item of items) {
|
||||
const year = item.dataset.year;
|
||||
if (year !== undefined) {
|
||||
if (!itemsByYear.has(year)) {
|
||||
itemsByYear.set(year, new Set([item]));
|
||||
} else {
|
||||
itemsByYear.get(year)?.add(item);
|
||||
}
|
||||
if (!year) continue;
|
||||
if (!itemsByYear.has(year)) {
|
||||
itemsByYear.set(year, new Set([item]));
|
||||
} else {
|
||||
itemsByYear.get(year)!.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue