Skip to content
Permalink
Browse files

src: remove unnecessary std::endl usage

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: #30003
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
danbev authored and targos committed Oct 17, 2019
1 parent 032c23d commit f6655b41fa5f8cfd7c178114769cd4a4e4b30bb1
Showing with 3 additions and 4 deletions.
  1. +3 −4 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;
}

0 comments on commit f6655b4

Please sign in to comment.
You can’t perform that action at this time.