refactor: clean up code formatting and improve timing logic in label generation functions

This commit is contained in:
StempunkDev 2026-02-13 18:12:11 +01:00
parent 689fef0858
commit 2379770bfa

View file

@ -48,7 +48,7 @@ class LabelsModule {
return existingIds[existingIds.length - 1] + 1; return existingIds[existingIds.length - 1] + 1;
} }
generate() : void { generate(): void {
this.clear(); this.clear();
generateStateLabels(); generateStateLabels();
generateBurgLabels(); generateBurgLabels();
@ -153,8 +153,7 @@ class LabelsModule {
* @param list - Optional array of stateIds to regenerate only those * @param list - Optional array of stateIds to regenerate only those
*/ */
export function generateStateLabels(list?: number[]): void { export function generateStateLabels(list?: number[]): void {
if (!TIME) console.time("generateStateLabels"); if (TIME) console.time("generateStateLabels");
else TIME && console.time("generateStateLabels");
const { states } = pack; const { states } = pack;
const labelsModule = window.Labels; const labelsModule = window.Labels;
@ -178,8 +177,7 @@ export function generateStateLabels(list?: number[]): void {
}); });
} }
if (!TIME) console.timeEnd("generateStateLabels"); if (TIME) console.timeEnd("generateStateLabels");
else TIME && console.timeEnd("generateStateLabels");
} }
/** /**
@ -200,7 +198,7 @@ export function generateBurgLabels(): void {
if (!burg.i || burg.removed) continue; if (!burg.i || burg.removed) continue;
const group = burg.group || "unmarked"; const group = burg.group || "unmarked";
// Get label group offset attributes if they exist (will be set during rendering) // Get label group offset attributes if they exist (will be set during rendering)
// For now, use defaults - these will be updated during rendering phase // For now, use defaults - these will be updated during rendering phase
const dx = 0; const dx = 0;