Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Riegeli usage cleanup:
Use
riegeli::SharedPtr
instead ofstd::shared_ptr
. Do not convert it fromstd::unique_ptr
:riegeli::SharedPtr
always allocates the control blocktogether with the object, hence this is not supported, and this is more
efficient anyway.
Utilize CTAD more.
Let
MaskedReader
constructor takeriegeli::Reader&
instead ofstd::unique_ptr<riegeli::Reader>
. There is no ownership transfer, theriegeli::Reader
is accessed only during construction.Use
riegeli::SharedBuffer
instead ofstd::shared_ptr<std::string>
inMaskedReader
. It has faster refcounting and a smaller overhead. It does nottrack the exact size but this is not needed here.
Use defaulted move constructor and move assignment of
MaskedReader
. They dothe right thing.
Add
MaskedReader::Reset()
to reset the instance to a state equivalent to anewly constructed state in-place.
Use
std::optional
instead ofabsl::optional
.Use
std::optional
or storing the value directly instead ofstd::unique_ptr
when movability is not needed.