Browse Source

Use stringstream reconstruction instead of using clear()

pipelines/353213535
eidheim 4 years ago
parent
commit
5adfeaa1c1
  1. 4
      src/source.cpp

4
src/source.cpp

@ -867,7 +867,6 @@ void Source::View::setup_format_style(bool is_generic_view) {
} }
stdout_buffer.write(bytes, n); stdout_buffer.write(bytes, n);
if(curly_count == 0) { if(curly_count == 0) {
key_or_value = false;
try { try {
JSON json(stdout_buffer); JSON json(stdout_buffer);
LockGuard lock(mutex); LockGuard lock(mutex);
@ -877,7 +876,8 @@ void Source::View::setup_format_style(bool is_generic_view) {
LockGuard lock(mutex); LockGuard lock(mutex);
error = Error{std::string(e.what()) + "\nOutput from prettier: " + stdout_buffer.str()}; error = Error{std::string(e.what()) + "\nOutput from prettier: " + stdout_buffer.str()};
} }
stdout_buffer.clear(); stdout_buffer = std::stringstream();
key_or_value = false;
} }
}, },
[](const char *bytes, size_t n) { [](const char *bytes, size_t n) {

Loading…
Cancel
Save