[Lldb-commits] [PATCH] D55584: Simplify boolean expressions

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 11 15:21:42 PST 2018


aprantl added a comment.

This one is probably less controversial than D55574 <https://reviews.llvm.org/D55574> :-)



================
Comment at: include/lldb/Target/ThreadPlanTracer.h:46
       TracingStarted();
-    else if (old_value == true && value == false)
+    else if (old_value && !value)
       TracingEnded();
----------------
is this actually better? Perhaps.


================
Comment at: source/DataFormatters/TypeCategoryMap.cpp:122
   Position p = First;
-  for (; false == m_active_categories.empty(); p++) {
+  for (; !m_active_categories.empty(); p++) {
     m_active_categories.front()->SetEnabledPosition(p);
----------------
this probably should be a while loop, or the initializer should go in the for.


================
Comment at: source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp:363
+    if (!image->HasKey("load_address") || !image->HasKey("pathname") ||
+        !image->HasKey("mod_date") || !image->HasKey("mach_header") ||
         image->GetValueForKey("mach_header")->GetAsDictionary() == nullptr ||
----------------
here the indentation actually got worse


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55584/new/

https://reviews.llvm.org/D55584





More information about the lldb-commits mailing list