Skip to content

Commit

Permalink
src: remove unnecessary std::endl usage
Browse files Browse the repository at this point in the history
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 MylesBorins committed Oct 23, 2019
1 parent 19a983c commit d561321
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand All @@ -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;
}

Expand Down

0 comments on commit d561321

Please sign in to comment.