inventory regions, minor refactor
This commit is contained in:
@@ -56,7 +56,11 @@ static void to_binary(ByteBuilder& builder, const Value* value) {
|
||||
static List* array_from_binary(ByteReader& reader);
|
||||
static Map* object_from_binary(ByteReader& reader);
|
||||
|
||||
std::vector<ubyte> json::to_binary(const Map* obj) {
|
||||
std::vector<ubyte> json::to_binary(const Map* obj, bool compress) {
|
||||
if (compress) {
|
||||
auto bytes = to_binary(obj, false);
|
||||
return gzip::compress(bytes.data(), bytes.size());
|
||||
}
|
||||
ByteBuilder builder;
|
||||
// type byte
|
||||
builder.put(BJSON_TYPE_DOCUMENT);
|
||||
|
||||
Reference in New Issue
Block a user