Loki-Astari / JsonBenchmark

Json benchmark based on nativejson-benchmark
Other
25 stars 6 forks source link

Cleaner Glaze usage #16

Closed stephenberry closed 2 months ago

stephenberry commented 2 months ago

I noticed you're using Glaze like this:

auto result = glz::read_json<std::vector<double>>(json);
if (result) {
   std::vector<double> data;
   data = std::move(result.value());

But, you can just do this:

std::vector<double> data;
auto error_code = glz::read_json(data, json);

This avoids the move and results in cleaner code.

Loki-Astari commented 2 months ago

I'll fix tonight.

Loki-Astari commented 2 months ago

OK. I see it.

I have fixed to the above style. I would note that this was only done on the conformance tests (not performance). The performance code already used the style indicated.

BUT: It is now all the same (or will be soon).