[PATCH] D21298: [Clang-tidy] delete null check

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 1 02:13:04 PST 2016


hokein accepted this revision.
hokein added a reviewer: hokein.
hokein added a comment.

It looks good to me, but you'd better wait for the approval from @aaron.ballman.



================
Comment at: clang-tidy/readability/DeleteNullPointerCheck.cpp:55
+      "'if' statement is unnecessary; deleting null pointer has no effect");
+  if (!IfWithDelete->getElse()) {
+    std::string ReplacementText = Lexer::getSourceText(
----------------
I would use an early return `if (IfWithDelete->getElse()) return` here.


https://reviews.llvm.org/D21298





More information about the cfe-commits mailing list