mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 03:17:50 +00:00
remove additional decodeFieldRow (and hopefully allocation)
This commit is contained in:
parent
e1b938e52c
commit
de071d548a
1 changed files with 6 additions and 16 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue