[PATCH] Refactor: Simplify boolean conditional return statements in tools/libclang

Paweł Bylica chfast at gmail.com
Tue May 26 02:55:55 PDT 2015


================
Comment at: tools/libclang/IndexingContext.cpp:807
@@ -806,6 +806,3 @@
   res = RefFileOccurrences.insert(RefOccur);
-  if (!res.second)
-    return true; // already in map.
-
-  return false;
+  return !res.second;
 }
----------------
Restore the comment.

================
Comment at: tools/libclang/IndexingContext.cpp:1155
@@ -1157,5 +1154,3 @@
     return false;
-  if (isa<ImportDecl>(D))
-    return false;
-  return true;
+  return !isa<ImportDecl>(D);
 }
----------------
I'm not sure about that. It breaks the symmetry.

http://reviews.llvm.org/D10024

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list