Skip to content

Commit

Permalink
Use better fitting writeback
Browse files Browse the repository at this point in the history
  • Loading branch information
PhictionalOne committed Jun 5, 2024
1 parent 4e2bb5b commit 887e0ba
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions extension/json/include/json_executors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ struct JSONExecutors {
// compute mutable result
auto new_val = fun(mut_doc->root, alc, result);

// Convert mutable value back to immutable document
doc = yyjson_mut_val_imut_copy(new_val, alc);

// Convert immutable yyjson document back into string
return JSONCommon::WriteVal<yyjson_val>(doc->root, alc);
return JSONCommon::WriteVal<yyjson_mut_val>(new_val, alc);
});
}

Expand Down Expand Up @@ -154,11 +150,7 @@ struct JSONExecutors {
// Compute mutable value
auto new_val = fun(mut_ldoc->root, right, alc, result);

// Convert mutable value back to immutable document
ldoc = yyjson_mut_val_imut_copy(new_val, alc);

// Convert immutable yyjson document back into string
return JSONCommon::WriteVal<yyjson_val>(ldoc->root, alc);
return JSONCommon::WriteVal<yyjson_mut_val>(new_val, alc);
});
}

Expand All @@ -185,11 +177,7 @@ struct JSONExecutors {
// Compute mutable value
auto new_val = fun(mut_doc->root, first, second, alc, result);

// mutable value back to immutable document
doc = yyjson_mut_val_imut_copy(new_val, alc);

// immutable document back to string
return JSONCommon::WriteVal<yyjson_val>(doc->root, alc);
return JSONCommon::WriteVal<yyjson_mut_val>(new_val, alc);
});
}

Expand Down

0 comments on commit 887e0ba

Please sign in to comment.