From e4d111fa0a33ff8cf6f20cec002782c8d04b383b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Justin=20Nu=C3=9F?= Date: Wed, 6 Apr 2016 14:15:26 +0200 Subject: [PATCH] Remove allocation when inserting into sublist --- server/sublist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/sublist.go b/server/sublist.go index 75d3710c..fd4cc12f 100644 --- a/server/sublist.go +++ b/server/sublist.go @@ -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