diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-11-16 22:56:30 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-11-16 22:56:30 +0000 |
commit | 06a0b937dd3f98e5f22c1ac6c41da57244b246be (patch) | |
tree | 6e767861e23fee419c59a62fde2e6d6603e8a6c4 | |
parent | b9ada27052f3036790d3a79f2133642be453cdc2 (diff) | |
download | bcm5719-llvm-06a0b937dd3f98e5f22c1ac6c41da57244b246be.tar.gz bcm5719-llvm-06a0b937dd3f98e5f22c1ac6c41da57244b246be.zip |
Demote a single-use named function object to a lambda
llvm-svn: 253267
-rw-r--r-- | llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h index 5604b93f220..2d05a520b50 100644 --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h @@ -53,14 +53,6 @@ protected: template<typename UnitType> class DWARFUnitSection final : public SmallVector<std::unique_ptr<UnitType>, 1>, public DWARFUnitSectionBase { - - struct UnitOffsetComparator { - bool operator()(uint32_t LHS, - const std::unique_ptr<UnitType> &RHS) const { - return LHS < RHS->getNextUnitOffset(); - } - }; - bool Parsed; public: @@ -73,8 +65,11 @@ public: typedef llvm::iterator_range<typename UnitVector::iterator> iterator_range; UnitType *getUnitForOffset(uint32_t Offset) const override { - auto *CU = std::upper_bound(this->begin(), this->end(), Offset, - UnitOffsetComparator()); + auto *CU = std::upper_bound( + this->begin(), this->end(), Offset, + [](uint32_t LHS, const std::unique_ptr<UnitType> &RHS) { + return LHS < RHS->getNextUnitOffset(); + }); if (CU != this->end()) return CU->get(); return nullptr; |