Skip to content

Commit

Permalink
Avoid zero size array creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Meyer, Wolfgang authored and Meyer, Wolfgang committed Feb 6, 2025
1 parent b97521b commit a116809
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 a116809

Please sign in to comment.