chore(messages): no need to append to a pre-allocated slice

This commit is contained in:
Christian Rocha
2025-07-19 15:16:03 -04:00
parent a4ac72f061
commit c37fe5317d

View File

@@ -206,7 +206,7 @@ func (m *messageCmp) renderUserMessage() string {
Background(t.BgSubtle)
attachments := make([]string, len(m.message.BinaryContent()))
for _, attachment := range m.message.BinaryContent() {
for i, attachment := range m.message.BinaryContent() {
file := filepath.Base(attachment.Path)
var filename string
runes := []rune(file)
@@ -218,7 +218,7 @@ func (m *messageCmp) renderUserMessage() string {
filename = fmt.Sprintf(" %s %s ", styles.DocumentIcon, file)
}
attachments = append(attachments, attachmentStyles.Render(filename))
attachments[i] = attachmentStyles.Render(filename)
}
if len(attachments) > 0 {