Merge pull request #239 from nuss-justin/remove-allocation-2

Remove allocation when inserting into sublist
This commit is contained in:
Derek Collison
2016-04-06 08:47:39 -07:00

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