Skip to content

Commit fb1f54b

Browse files
authored
fix/logevents-store-allocation-improvement (#21849)
1 parent af7baca commit fb1f54b

File tree

1 file changed

+1
-1
lines changed
  • core/capabilities/triggers/logevent

1 file changed

+1
-1
lines changed

core/capabilities/triggers/logevent/store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (cs *capabilitiesStore[T, Resp]) Read(capabilityID string) (value *T, ok bo
4141
func (cs *capabilitiesStore[T, Resp]) ReadAll() (values []*T) {
4242
cs.mu.RLock()
4343
defer cs.mu.RUnlock()
44-
vals := make([]*T, 0)
44+
vals := make([]*T, 0, len(cs.capabilities))
4545
for _, v := range cs.capabilities {
4646
vals = append(vals, v)
4747
}

0 commit comments

Comments
 (0)