Skip to content

Commit

Permalink
Avoid zero size array creation (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: Meyer, Wolfgang <[email protected]>
  • Loading branch information
vortex-surfer and Meyer, Wolfgang authored Feb 7, 2025
1 parent b97521b commit 0d06b73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/compiler_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ ${pforms.map(pf => ` .plurals[${pf_enum[pf]}] = ${loc}_plurals_${pf},`).join(
}

function generate_idx(keys) {
let result = '';
let result = keys.length > 0 ? '' : ' NULL,';
Object.values(keys).forEach(k => {
result += '\"' + esc(k) + '\",\n';
result += ' \"' + esc(k) + '\",\n';
});

return result;
Expand Down

0 comments on commit 0d06b73

Please sign in to comment.