Use proto reader iterator when proto enabled#2375
Conversation
aae7669 to
d1fe6aa
Compare
| intOptimized := m3tsz.DefaultIntOptimizationEnabled | ||
| return m3tsz.NewReaderIterator(r, intOptimized, encodingOpts) | ||
| v = v.SetReaderIteratorAllocate(func(r io.Reader, descr namespace.SchemaDescr) encoding.ReaderIterator { | ||
| if c.Proto != nil && c.Proto.Enabled { |
There was a problem hiding this comment.
Hm instead of this if/else here, can you just entirely override with:
v = v.SetReaderIteratorAllocate(func(r io.Reader, descr namespace.SchemaDescr) encoding.ReaderIterator {
return proto.NewIterator(r, descr, encodingOpts)
})From within the block below?
if c.Proto != nil && c.Proto.Enabled {
v = v.SetXyz(...)
// ..
}| }) | ||
|
|
||
| if c.Proto != nil && c.Proto.Enabled { | ||
| v = v.SetReaderIteratorAllocate(func(r io.Reader, descr namespace.SchemaDescr) encoding.ReaderIterator { |
There was a problem hiding this comment.
As discussed in chat--let's add a unittest for this and then I'm good.
834e25e to
99f874f
Compare
e130b7e to
3cf877e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2375 +/- ##
========================================
- Coverage 71.7% 71.7% -0.1%
========================================
Files 1051 1051
Lines 92476 92479 +3
========================================
- Hits 66383 66381 -2
- Misses 21655 21658 +3
- Partials 4438 4440 +2
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
What this PR does / why we need it:
Use the proto
encoding.ReaderIteratorwhen proto is enabled.Special notes for your reviewer: N/A
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: