[Lldb-commits] [PATCH] D123502: [lldb][NFC] Refactor printing of short options in help

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 11 21:49:42 PDT 2022


JDevlieghere added inline comments.


================
Comment at: lldb/source/Interpreter/Options.cpp:457
 
-      if (!options.empty()) {
-        // We have some required options with no arguments
+      if (required_options.size()) {
         strm.PutCString(" -");
----------------
I'm surprised you change this from `!empty()` to `size()`. I personally think the former is more readable. Not an issue in practice, but I do believe the STL guarantees `::empty` to be `O(1)` while technically `::size` could be `O(n)`, though I think in practice they're both `O(1)`. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123502



More information about the lldb-commits mailing list