Update Lix to latest revision #8
Loading…
Reference in a new issue
No description provided.
Delete branch "ma27:lix-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
cc @delroth @leo60228
cc @jade who authored the related Lix change. Would be nice if you could double-check if I didn't mess anything up in
e92ac734e6
:)i mean there's really nothing wrong with this code but there's a couple things you could make a bit better
@ -12,0 +18,4 @@
public:
MyFileHandle(NarMemberData * memberData, uint64_t size) : memberData(memberData)
{
expectedSize = size;
should be in the initializer above rather than in the function itself
@ -12,0 +19,4 @@
MyFileHandle(NarMemberData * memberData, uint64_t size) : memberData(memberData)
{
expectedSize = size;
hashSink = std::make_unique<HashSink>(HashType::SHA256);
does this actually have to be behind a pointer? only reason i can see that it would is being big but i don't think it's big.
edit: oh, it might be the reset() maybe? so that it becomes null and crashes if you put extra data in it?
I guess we can leave that as-is then, correct @jade?
yeah you can leave it alone, it's fine.
@ -32,2 +60,3 @@
std::unique_ptr<FileHandle> createRegularFile(const Path & path, uint64_t size, bool executable) override
{
curMember = &members.insert_or_assign(prefix + path, NarMemberData {
auto memberData = &members.insert_or_assign(prefix + path, NarMemberData {
probably should be
auto *
right?or you could refactor it into being a reference now that the field doesn't need to be reassigned; either way.
To be clear, that's also helpful for me!
I mostly do C++ because I'm interested in hacking on Lix & Hydra, so getting input on how to do things better is very valuable to me. Thank you!
I'll try to get back to you this weekend for that.
(ah fyi the reason ours was using the constructor and new instead of make_unique is that it was a private constructor and so the template couldn't call it. not the case here; doesn't strictly need to be the case because it's unrealistic anyone would call that constructor when they shouldn't, so you can just leave it as-is)
cc @vriska @yu-re-ka @raito
ignoreException
has been split into two 995e1922d7Thanks, I pushed these changes to the main branch with some rearrangements of the commit (squashed the "address review-comments" into the previous commit etc)
Pull request closed