Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: tools/gn/command_format.cc

Issue 2384493003: Fix GN issues identified by MSVC static analysis. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_format.cc
diff --git a/tools/gn/command_format.cc b/tools/gn/command_format.cc
index dafba6ede6f62d1ed98dea44ce64d6ce9143e550..282f56764599be0702f8d2ddd14d8d2d46668872 100644
--- a/tools/gn/command_format.cc
+++ b/tools/gn/command_format.cc
@@ -323,7 +323,7 @@ void Printer::AnnotatePreferredMultilineAssignment(const BinaryOpNode* binop) {
}
void Printer::SortIfSourcesOrDeps(const BinaryOpNode* binop) {
- if (binop && binop->comments() && !binop->comments()->before().empty() &&
+ if (binop->comments() && !binop->comments()->before().empty() &&
binop->comments()->before()[0].value().as_string() == "# NOSORT") {
// Allow disabling of sort for specific actions that might be
// order-sensitive.
@@ -746,7 +746,7 @@ int Printer::FunctionCall(const FunctionCallNode* func_call,
const auto& list = func_call->args()->contents();
const ParseNode* end = func_call->args()->End();
- if (end && end->comments() && !end->comments()->before().empty())
+ if (end->comments() && !end->comments()->before().empty())
force_multiline = true;
// If there's before line comments, make sure we have a place to put them.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698