From 8952fc5acff74989497c03c5f52068d394f3b55e Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Fri, 17 Jan 2014 18:05:34 -0500 Subject: [PATCH] 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. --- btcdrpc.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/btcdrpc.go b/btcdrpc.go index e06029b..51061d2 100644 --- a/btcdrpc.go +++ b/btcdrpc.go @@ -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 }