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

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 12 03:40:30 PDT 2022


DavidSpickett marked an inline comment as done.
DavidSpickett 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(" -");
----------------
JDevlieghere wrote:
> 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)`. 
Fair point. I'll keep to the original style.


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