[Lldb-commits] [PATCH] D77327: [nfc] [lldb] 2/2: Introduce DWARF callbacks
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 7 23:57:42 PDT 2020
labath 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);
----------------
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.)
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