Skip to content

Commit 0f6c728

Browse files
authored
Merge pull request #2 from coregx/fix/prealloc-linter
fix: pre-allocate mappings slice (CI linter)
2 parents 421fd77 + 262cf05 commit 0f6c728

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/fonts/tounicode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type glyphMapping struct {
6969
// This CMap maps those glyph IDs back to Unicode code points for text extraction.
7070
func writeCharMappings(buf *bytes.Buffer, subset *FontSubset) error {
7171
// Build glyph ID → Unicode mappings.
72-
var mappings []glyphMapping
72+
mappings := make([]glyphMapping, 0, len(subset.UsedChars))
7373

7474
for ch := range subset.UsedChars {
7575
glyphID, ok := subset.BaseFont.CharToGlyph[ch]

0 commit comments

Comments
 (0)