[Lldb-commits] [PATCH] D77327: [nfc] [lldb] 2/2: Introduce DWARF callbacks
Jan Kratochvil via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 8 01:35:14 PDT 2020
jankratochvil marked 2 inline comments as done.
jankratochvil added inline comments.
================
Comment at: lldb/include/lldb/Core/UniqueCStringMap.h:190-195
+ const_iterator left = llvm::lower_bound(m_map, unique_cstr, Compare());
+ if (left != m_map.end() && left->cstring != unique_cstr)
+ left = m_map.end();
+ const_iterator right =
+ std::upper_bound(left, m_map.end(), unique_cstr, Compare());
+ return llvm::make_range(left, right);
----------------
labath wrote:
> Looks better, but I have a feeling it could be simplified even further. Wouldn't a plain `return llvm::make_range(std::equal_range(m_map.begin(), m_map.end(), Compare());` work just as well? (Sorry for taking you down the wrong path with the lower/upper_bound comment -- equal_range is basically a combination of lower_bound and upper_bound calls.)
Yes, sorry, I was never using these functions before.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77327/new/
https://reviews.llvm.org/D77327
More information about the lldb-commits
mailing list