Skip to content

Commit

Permalink
Prevent redundant copies when pulling in queried data-points
Browse files Browse the repository at this point in the history
  • Loading branch information
neurodrone committed Jul 15, 2014
1 parent 4f0e6f1 commit 5503d54
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions client/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,9 @@ func (self *Client) queryCommon(query string, useNumber bool, precision ...TimeP
return nil, err
}
defer resp.Body.Close()
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}

series := []*Series{}
decoder := json.NewDecoder(bytes.NewBuffer(data))
decoder := json.NewDecoder(resp.Body)
if useNumber {
decoder.UseNumber()
}
Expand Down

0 comments on commit 5503d54

Please sign in to comment.