Skip to content

Commit

Permalink
use producers array element directly (with casting)
Browse files Browse the repository at this point in the history
  • Loading branch information
ploxiln committed Oct 21, 2014
1 parent 6d83da1 commit b811579
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
"sync"
"sync/atomic"
"time"

"github.com/bitly/go-simplejson"
)

// Handler is the message processing interface for Consumer
Expand Down Expand Up @@ -405,8 +407,8 @@ func (r *Consumer) queryLookupd() {
// }
producersArray := data.Get("Producers").MustArray()
nsqdAddrs := make([]string, len(producersArray))
for i := range producersArray {
producer := data.Get("Producers").GetIndex(i)
for _, element := range producersArray {
producer := element.(*simplejson.Json)
broadcastAddress := producer.Get("broadcast_address").MustString()
port := producer.Get("tcp_port").MustInt()
joined := net.JoinHostPort(broadcastAddress, strconv.Itoa(port))
Expand Down

0 comments on commit b811579

Please sign in to comment.