don't stand on your head to take a pointer

the whole stack argument doesn't make much sense in golang; escape analysis
should allocate in heap.
This commit is contained in:
vyzo 2018-10-29 12:38:03 +02:00
parent 575cf339f4
commit 86e65e589d

View File

@ -434,14 +434,9 @@ func (p *PubSub) doAnnounceRetry(pid peer.ID, topic string, sub bool) {
return
}
// don't take pointers to the goroutine stack
topicP := new(string)
subP := new(bool)
*topicP = topic
*subP = sub
subopt := &pb.RPC_SubOpts{
Topicid: topicP,
Subscribe: subP,
Topicid: &topic,
Subscribe: &sub,
}
out := rpcWithSubs(subopt)