From 427ec305fcf42031264da00140d05ef5cb1ddeec Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Fri, 3 Mar 2017 16:03:08 +0100 Subject: [PATCH] One more use of the scratch of redis client. --- common/redisclient.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/redisclient.go b/common/redisclient.go index b5a6070..1e4126d 100644 --- a/common/redisclient.go +++ b/common/redisclient.go @@ -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)