Skip to content

Commit bc83fb6

Browse files
committed
fix: pre-allocate result slice in GetFieldsToUpdate
1 parent 25e12b0 commit bc83fb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/application/forms/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func (w *Writer) setValueInDict(dict *parser.Dictionary, fieldType FieldType, va
191191
// GetFieldsToUpdate returns field info for all fields that have updates.
192192
func (w *Writer) GetFieldsToUpdate() ([]*FieldInfo, error) {
193193
reader := NewReader(w.pdfReader)
194-
var result []*FieldInfo
194+
result := make([]*FieldInfo, 0, len(w.updates))
195195

196196
for name := range w.updates {
197197
field, err := reader.GetFieldByName(name)

0 commit comments

Comments
 (0)