One more use of the scratch of redis client.

This commit is contained in:
Sascha L. Teichmann 2017-03-03 16:03:08 +01:00
parent 41187af7db
commit 427ec305fc
1 changed files with 4 additions and 3 deletions

View File

@ -136,14 +136,15 @@ func (client *RedisClient) QueryCuboid(cuboid Cuboid, fn func(*Block)) (count in
key int64
)
for ; ; count++ {
if size, err = client.readBulkString(&data); err != nil {
for s := client.scratch[:]; ; count++ {
p := &s
if size, err = client.readBulkString(p); err != nil {
return
}
if size <= 0 {
break
}
if key, err = DecodeStringFromBytes(data[:size]); err != nil {
if key, err = DecodeStringFromBytes((*p)[:size]); err != nil {
return
}
block.Coord = PlainToCoord(key)