Remove unnecessary string copy.

Strings are immutable, so instead of copying as a new variable (like
how was needed when receiving byte slices), just pass the marshaled
JSON string to the notification processing code.
This commit is contained in:
Josh Rickmar 2014-01-17 18:05:34 -05:00
parent 11ea5e31b4
commit 8952fc5acf

View file

@ -213,11 +213,8 @@ func (btcd *BtcdRPCConn) Start() {
// Try notifications (requests with nil ids) first.
n, err := unmarshalNotification(m)
if err == nil {
// Make a copy of the marshaled notification.
mcopy := m
// Begin processing the notification.
go processNotification(n, mcopy)
go processNotification(n, m)
continue
}