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 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits