Fix unchecked error in templated Read${TYPE}Block

pull/7744/head
Mark Rushakoff 2016-12-19 09:31:26 -08:00
parent 55afd56cc2
commit 722b6345fe
2 changed files with 15 additions and 0 deletions

View File

@ -17,6 +17,9 @@ func (c *KeyCursor) ReadFloatBlock(buf *[]FloatValue) ([]FloatValue, error) {
first := c.current[0] first := c.current[0]
*buf = (*buf)[:0] *buf = (*buf)[:0]
values, err := first.r.ReadFloatBlockAt(&first.entry, buf) values, err := first.r.ReadFloatBlockAt(&first.entry, buf)
if err != nil {
return nil, err
}
// Remove values we already read // Remove values we already read
values = FloatValues(values).Exclude(first.readMin, first.readMax) values = FloatValues(values).Exclude(first.readMin, first.readMax)
@ -177,6 +180,9 @@ func (c *KeyCursor) ReadIntegerBlock(buf *[]IntegerValue) ([]IntegerValue, error
first := c.current[0] first := c.current[0]
*buf = (*buf)[:0] *buf = (*buf)[:0]
values, err := first.r.ReadIntegerBlockAt(&first.entry, buf) values, err := first.r.ReadIntegerBlockAt(&first.entry, buf)
if err != nil {
return nil, err
}
// Remove values we already read // Remove values we already read
values = IntegerValues(values).Exclude(first.readMin, first.readMax) values = IntegerValues(values).Exclude(first.readMin, first.readMax)
@ -337,6 +343,9 @@ func (c *KeyCursor) ReadStringBlock(buf *[]StringValue) ([]StringValue, error) {
first := c.current[0] first := c.current[0]
*buf = (*buf)[:0] *buf = (*buf)[:0]
values, err := first.r.ReadStringBlockAt(&first.entry, buf) values, err := first.r.ReadStringBlockAt(&first.entry, buf)
if err != nil {
return nil, err
}
// Remove values we already read // Remove values we already read
values = StringValues(values).Exclude(first.readMin, first.readMax) values = StringValues(values).Exclude(first.readMin, first.readMax)
@ -497,6 +506,9 @@ func (c *KeyCursor) ReadBooleanBlock(buf *[]BooleanValue) ([]BooleanValue, error
first := c.current[0] first := c.current[0]
*buf = (*buf)[:0] *buf = (*buf)[:0]
values, err := first.r.ReadBooleanBlockAt(&first.entry, buf) values, err := first.r.ReadBooleanBlockAt(&first.entry, buf)
if err != nil {
return nil, err
}
// Remove values we already read // Remove values we already read
values = BooleanValues(values).Exclude(first.readMin, first.readMax) values = BooleanValues(values).Exclude(first.readMin, first.readMax)

View File

@ -13,6 +13,9 @@ func (c *KeyCursor) Read{{.Name}}Block(buf *[]{{.Name}}Value) ([]{{.Name}}Value,
first := c.current[0] first := c.current[0]
*buf = (*buf)[:0] *buf = (*buf)[:0]
values, err := first.r.Read{{.Name}}BlockAt(&first.entry, buf) values, err := first.r.Read{{.Name}}BlockAt(&first.entry, buf)
if err != nil {
return nil, err
}
// Remove values we already read // Remove values we already read
values = {{.Name}}Values(values).Exclude(first.readMin, first.readMax) values = {{.Name}}Values(values).Exclude(first.readMin, first.readMax)