Commit 4578000
perf: pre-allocate slice capacity in assistantMessageParam
Pre-allocate the `blocks` slice in `assistantMessageParam` with `make([]anthropic.ContentBlockParamUnion, 0, len(m.Parts))` to prevent multiple memory reallocations during `append` operations.
Co-authored-by: matdev83 <211248003+matdev83@users.noreply.github.com>1 parent 02325fe commit 4578000
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
0 commit comments