Restructure NAR streaming to remove one pointer indirection (#2)

We can pass the two fields directly via the FFI instead of
bundling them in a `String_` struct
This commit is contained in:
Gabriella Gonzalez
2022-08-29 11:35:58 -07:00
committed by GitHub
parent 0242d8bebb
commit 4ac870a142
2 changed files with 27 additions and 13 deletions

View File

@@ -161,7 +161,7 @@ void signString
bool dumpPath
( char const * const hashPart
, bool (* const callback)(struct string const * const)
, bool (* const callback)(char const * const data, size_t const size)
)
{
ref<Store> store = getStore();
@@ -171,9 +171,7 @@ bool dumpPath
if (storePath.has_value()) {
LambdaSink sink([=](std::string_view v) {
struct string s = { .data = v.data(), .size = v.size() };
bool succeeded = (*callback)(&s);
bool succeeded = (*callback)(v.data(), v.size());
if (!succeeded) {
// We don't really care about the error message. The only