[Lldb-commits] [PATCH] D110410: [lldb] [Host] Refactor XML converting getters

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 27 03:57:19 PDT 2021


mgorny added inline comments.


================
Comment at: lldb/source/Host/common/XML.cpp:299-304
+  std::string text;
+  if (GetElementText(text) && llvm::to_integer(text,value, base))
+    return true;
+
+  value = fail_value;
+  return false;
----------------
labath wrote:
> /me wonders if it would be too weird to rely on the fact that to_integer does not modify the result variable on failure.
> 
> It would definitely streamline this code:
> ```
> value = fail_value;
> return GetElementText(text) && llvm::to_integer(text,value, base);
> ```
Other code in LLDB already does that, so I suppose it's fine.


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

https://reviews.llvm.org/D110410



More information about the lldb-commits mailing list