From d561321e4a6a2775c7dc6782f05035bef66fed9d Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 17 Oct 2019 09:23:32 +0200 Subject: [PATCH] src: remove unnecessary std::endl usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit removes a few std::endl that could be replaced by '\n' as it does not look like the buffer needs to be flushed in these places. This is only done in error handling, and once when the report has been generated, so this is very minor but I thought I'd bring it up in case it was overlooked. PR-URL: https://github.com/nodejs/node/pull/30003 Reviewed-By: Gireesh Punathil Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau Reviewed-By: Tobias Nießen --- src/node_report.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/node_report.cc b/src/node_report.cc index 25a4d671c8f1bd..ddeb216c82d6bc 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -110,8 +110,7 @@ std::string TriggerNodeReport(Isolate* isolate, } // Check for errors on the file open if (!outfile.is_open()) { - std::cerr << std::endl - << "Failed to open Node.js report file: " << filename; + std::cerr << "\nFailed to open Node.js report file: " << filename; if (env != nullptr && options->report_directory.length() > 0) std::cerr << " directory: " << options->report_directory; @@ -120,7 +119,7 @@ std::string TriggerNodeReport(Isolate* isolate, return ""; } outstream = &outfile; - std::cerr << std::endl << "Writing Node.js report to file: " << filename; + std::cerr << "\nWriting Node.js report to file: " << filename; } WriteNodeReport(isolate, env, message, trigger, filename, *outstream, @@ -131,7 +130,7 @@ std::string TriggerNodeReport(Isolate* isolate, outfile.close(); } - std::cerr << std::endl << "Node.js report completed" << std::endl; + std::cerr << "\nNode.js report completed" << std::endl; return filename; }