[Lldb-commits] [PATCH] D150716: [lldb][NFCI] Switch to using llvm::DWARFAbbreviationDeclaration
Adrian Prantl via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu May 18 14:28:01 PDT 2023
aprantl added inline comments.
================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp:56
if (m_idx_offset == UINT32_MAX) {
- DWARFAbbreviationDeclarationCollConstIter pos;
- DWARFAbbreviationDeclarationCollConstIter end = m_decls.end();
- for (pos = m_decls.begin(); pos != end; ++pos) {
- if (pos->Code() == abbrCode)
- return &(*pos);
+ for (const auto &decl : m_decls) {
+ if (decl.getCode() == abbrCode)
----------------
bulbazord wrote:
> aprantl wrote:
> > would std::find_if be shorter or would it look worse?
> ```
> for (const auto &decl : m_decls) {
> if (decl.getCode() == abbrCode)
> return &decl;
> }
> ```
> vs.
> ```
> auto pos = std::find_if(
> m_decls.begin(), m_decls.end(),
> [abbrCode](const auto &decl) { return decl.getCode() == abbrCode; });
> if (pos != m_decls.end())
> return &*pos;
> ```
>
> I think it would look worse, personally.
Agreed!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150716/new/
https://reviews.llvm.org/D150716
More information about the lldb-commits
mailing list