about summary refs log tree commit diff stats
path: root/gomponents.go
diff options
context:
space:
mode:
Diffstat (limited to 'gomponents.go')
-rw-r--r--gomponents.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/gomponents.go b/gomponents.go
index 735ad00..ad9c2cd 100644
--- a/gomponents.go
+++ b/gomponents.go
@@ -250,7 +250,7 @@ func Rawf(format string, a ...interface{}) Node {
 
 // Map a slice of anything to a [Group] (which is just a slice of [Node]-s).
 func Map[T any](ts []T, cb func(T) Node) Group {
-	var nodes []Node
+	nodes := make([]Node, 0, len(ts))
 	for _, t := range ts {
 		nodes = append(nodes, cb(t))
 	}