For symmetry inline readline function in redis client.

This commit is contained in:
Sascha L. Teichmann 2017-02-24 21:23:04 +01:00
parent 744208ba00
commit b6bfe468b7

View File

@ -70,10 +70,6 @@ func (client *RedisClient) writeHSpatial(p1, p2 int64) (err error) {
return return
} }
func (client *RedisClient) readLine() (data []byte, err error) {
return client.reader.ReadBytes('\n')
}
func isError(line []byte) error { func isError(line []byte) error {
if len(line) > 0 && line[0] == '-' { if len(line) > 0 && line[0] == '-' {
return fmt.Errorf("error: %s", line[1:]) return fmt.Errorf("error: %s", line[1:])
@ -83,7 +79,7 @@ func isError(line []byte) error {
func (client *RedisClient) readBulkString(data *[]byte) (size int, err error) { func (client *RedisClient) readBulkString(data *[]byte) (size int, err error) {
var line []byte var line []byte
if line, err = client.readLine(); err != nil { if line, err = client.reader.ReadBytes('\n'); err != nil {
return return
} }
if err = isError(line); err != nil { if err = isError(line); err != nil {