use std::string in node bindings

This commit is contained in:
Siarhei Fedartsou 2022-09-30 16:09:20 +02:00
parent 3781068a22
commit 666ff1c9e5

View File

@ -167,13 +167,13 @@ inline void async(const Nan::FunctionCallbackInfo<v8::Value> &info,
ParseResult(status, json_result); ParseResult(status, json_result);
if (pluginParams.renderToBuffer) if (pluginParams.renderToBuffer)
{ {
std::ostringstream buf; std::string json_string;
osrm::util::json::render(buf, json_result); osrm::util::json::render(json_string, json_result);
result = buf.str(); result = std::move(json_string);
} }
else else
{ {
result = json_result; result = std::move(json_result);
} }
} }
break; break;