Skip to content

Commit

Permalink
dont expose Pipe.Count()
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Zimmermann committed Jan 15, 2012
1 parent 95b238a commit 9830056
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions commands.go
Expand Up @@ -730,9 +730,9 @@ func (pc *PipeClient) Exec() []*Reply {
Send(p, []byte("EXEC"))
}

replies := make([]*Reply, 0, p.Count())
replies := make([]*Reply, 0, p.count())

for p.Count() > 0 {
for p.count() > 0 {
replies = append(replies, p.getReply())
}

Expand All @@ -750,7 +750,7 @@ func (pc *PipeClient) Exec() []*Reply {
func (pc *PipeClient) Multi() error {
p := pc.pipe()

if p.Count() > 0 {
if p.count() > 0 {
return errors.New("Cannot issue MULTI on a buffered pipe")
}

Expand Down
6 changes: 3 additions & 3 deletions godis.go
Expand Up @@ -150,7 +150,7 @@ func (p *Pipe) read(conn *conn) *Reply {

reply := conn.readReply()

if p.Count() == 0 {
if p.count() == 0 {
p.free()
}

Expand Down Expand Up @@ -185,7 +185,7 @@ func (p *Pipe) write(cmd []byte) (*conn, error) {

// read a reply from the socket if we are expecting it.
func (p *Pipe) getReply() *Reply {
if p.Count() == 0 {
if p.count() == 0 {
p.appendMode = true
p.transaction = false
return &Reply{Err: errors.New("No replies expected from conn")}
Expand All @@ -197,7 +197,7 @@ func (p *Pipe) getReply() *Reply {
}

// retrieve the number of replies available
func (p *Pipe) Count() int {
func (p *Pipe) count() int {
return p.replyCount
}

Expand Down

0 comments on commit 9830056

Please sign in to comment.