remove additional decodeFieldRow (and hopefully allocation)

This commit is contained in:
Travis Turner 2018-08-24 15:28:18 -05:00
parent e1b938e52c
commit de071d548a
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9

View file

@ -1012,18 +1012,12 @@ func decodeGroupByCounts(a []*internal.GroupLine) pilosa.GroupByCounts {
func decodeFieldRows(a []*internal.FieldRow) []pilosa.FieldRow {
other := make([]pilosa.FieldRow, len(a))
for i := range a {
other[i] = decodeFieldRow(a[i])
other[i].Field = a[i].Field
other[i].RowID = a[i].RowID
}
return other
}
func decodeFieldRow(pb *internal.FieldRow) pilosa.FieldRow {
return pilosa.FieldRow{
Field: pb.Field,
RowID: pb.RowID,
}
}
func decodePairs(a []*internal.Pair) []pilosa.Pair {
other := make([]pilosa.Pair, len(a))
for i := range a {
@ -1089,18 +1083,14 @@ func encodeGroupByCount(counts pilosa.GroupByCounts) []*internal.GroupLine {
func encodeFieldRows(a []pilosa.FieldRow) []*internal.FieldRow {
other := make([]*internal.FieldRow, len(a))
for i := range a {
other[i] = encodeFieldRow(a[i])
other[i] = &internal.FieldRow{
Field: a[i].Field,
RowID: a[i].RowID,
}
}
return other
}
func encodeFieldRow(p pilosa.FieldRow) *internal.FieldRow {
return &internal.FieldRow{
Field: p.Field,
RowID: p.RowID,
}
}
func encodePairs(a pilosa.Pairs) []*internal.Pair {
other := make([]*internal.Pair, len(a))
for i := range a {