Remove allocation when inserting into sublist

This commit is contained in:
Justin Nuß
2016-04-06 14:15:26 +02:00
parent 06e121a05e
commit e4d111fa0a

View File

@@ -83,7 +83,7 @@ func NewSublist() *Sublist {
// Insert adds a subscription into the sublist
func (s *Sublist) Insert(sub *subscription) error {
// copy the subject since we hold this and this might be part of a large byte slice.
subject := string(append([]byte(nil), sub.subject...))
subject := string(sub.subject)
tsa := [32]string{}
tokens := tsa[:0]
start := 0