remove some code duplication in IndexOptions

This commit is contained in:
Travis 2017-09-16 18:23:40 -05:00
parent 80603ef28a
commit c8c2229ca3
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9
2 changed files with 5 additions and 7 deletions

View file

@ -924,10 +924,10 @@ func encodeFrames(a []*Frame) []*internal.Frame {
// encodeFrame converts f into its internal representation.
func encodeFrame(f *Frame) *internal.Frame {
options := f.Options()
fo := f.options()
return &internal.Frame{
Name: f.name,
Meta: options.Encode(),
Meta: fo.Encode(),
}
}

View file

@ -614,12 +614,10 @@ func EncodeIndexes(a []*Index) []*internal.Index {
// encodeIndex converts d into its internal representation.
func encodeIndex(d *Index) *internal.Index {
io := d.options()
return &internal.Index{
Name: d.name,
Meta: &internal.IndexMeta{
ColumnLabel: d.columnLabel,
TimeQuantum: string(d.timeQuantum),
},
Name: d.name,
Meta: io.Encode(),
MaxSlice: d.MaxSlice(),
Frames: encodeFrames(d.Frames()),
}