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



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to