labath added inline comments.
================
Comment at: lldb/source/Host/common/LZMA.cpp:84
+ lzma_ret xzerr = lzma_stream_footer_decode(
+ &opts, InputBuffer.data() + InputBuffer.size() -
LZMA_STREAM_HEADER_SIZE);
+ if (xzerr != LZMA_OK) {
----------------
kwk wrote:
> labath wrote:
> > Maybe `InputBuffer.take_back(LZMA_STREAM_HEADER_SIZE).data()` ?
> `take_back`:
>
>
> > Return a copy of *this with only the last \p N elements.
>
> I mean `LZMA_STREAM_HEADER_SIZE` is only 12 but do we really need it?
>
Yeah, that documentation is somewhat misleading. If you look at the
implementation you'll see that there's no copying involved (ArrayRefs never
copy anything -- that's their whole point of existence). So, I still think that
this is better/more readable with `take_back`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66791/new/
https://reviews.llvm.org/D66791
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits