Skip to content

Commit

Permalink
Builder should be passed by reference in --ungron to not copy datastr…
Browse files Browse the repository at this point in the history
…ucture
  • Loading branch information
adamritter committed Dec 6, 2023
1 parent 25ba14c commit fd3a34a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/print_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "batched_print.hpp"
#include "jsonutils.hpp"

void print_json_inner(Builder builder, const unsigned flags, growing_string &indent);
void print_json_inner(Builder& builder, const unsigned flags, growing_string &indent);

void print_vector(Vector &vector_holder, const unsigned flags, growing_string &indent)
{
Expand Down Expand Up @@ -80,7 +80,7 @@ void print_map(Map &map_holder, const unsigned flags, growing_string &indent)
batched_print("}");
}

void print_json_inner(Builder builder, const unsigned flags, growing_string &indent)
void print_json_inner(Builder& builder, const unsigned flags, growing_string &indent)
{
if (std::holds_alternative<string_variant>(builder))
{
Expand All @@ -102,7 +102,7 @@ void print_json_inner(Builder builder, const unsigned flags, growing_string &ind
}
}

void print_json(Builder builder, const unsigned flags)
void print_json(Builder& builder, const unsigned flags)
{
growing_string indent;
batched_out.reserve_extra(1000000);
Expand Down
2 changes: 1 addition & 1 deletion src/print_json.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once
#include "builder.hpp"

void print_json(Builder builder, const unsigned flags);
void print_json(Builder& builder, const unsigned flags);

0 comments on commit fd3a34a

Please sign in to comment.