mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
remove some code duplication in FrameOption encoding
This commit is contained in:
parent
27921564c0
commit
80603ef28a
1 changed files with 3 additions and 11 deletions
14
frame.go
14
frame.go
|
|
@ -223,7 +223,7 @@ func (f *Frame) Options() FrameOptions {
|
|||
}
|
||||
|
||||
func (f *Frame) options() FrameOptions {
|
||||
opt := FrameOptions{
|
||||
return FrameOptions{
|
||||
RowLabel: f.rowLabel,
|
||||
InverseEnabled: f.inverseEnabled,
|
||||
RangeEnabled: f.rangeEnabled,
|
||||
|
|
@ -232,7 +232,6 @@ func (f *Frame) options() FrameOptions {
|
|||
TimeQuantum: f.timeQuantum,
|
||||
Fields: f.schema.Fields,
|
||||
}
|
||||
return opt
|
||||
}
|
||||
|
||||
// Open opens and initializes the frame.
|
||||
|
|
@ -925,17 +924,10 @@ func encodeFrames(a []*Frame) []*internal.Frame {
|
|||
|
||||
// encodeFrame converts f into its internal representation.
|
||||
func encodeFrame(f *Frame) *internal.Frame {
|
||||
options := f.Options()
|
||||
return &internal.Frame{
|
||||
Name: f.name,
|
||||
Meta: &internal.FrameMeta{
|
||||
RowLabel: f.rowLabel,
|
||||
InverseEnabled: f.inverseEnabled,
|
||||
RangeEnabled: f.rangeEnabled,
|
||||
CacheType: f.cacheType,
|
||||
CacheSize: f.cacheSize,
|
||||
TimeQuantum: string(f.timeQuantum),
|
||||
Fields: encodeFields(f.schema.Fields),
|
||||
},
|
||||
Meta: options.Encode(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue