[PATCH] D152158: [AppleAccelTable][NFC] Improve code readability

Felipe de Azevedo Piovezan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 07:02:48 PDT 2023


fdeazeve updated this revision to Diff 528424.
fdeazeve added a comment.

Update base


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152158/new/

https://reviews.llvm.org/D152158

Files:
  llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp


Index: llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
@@ -275,18 +275,18 @@
 
 void AppleAcceleratorTable::Entry::extract(
     const AppleAcceleratorTable &AccelTable, uint64_t *Offset) {
-  for (auto &Atom : Values)
-    Atom.extractValue(AccelTable.AccelSection, Offset, AccelTable.FormParams);
+  for (auto &FormValue : Values)
+    FormValue.extractValue(AccelTable.AccelSection, Offset,
+                           AccelTable.FormParams);
 }
 
 std::optional<DWARFFormValue>
-AppleAcceleratorTable::Entry::lookup(HeaderData::AtomType Atom) const {
+AppleAcceleratorTable::Entry::lookup(HeaderData::AtomType AtomToFind) const {
   assert(HdrData && "Dereferencing end iterator?");
   assert(HdrData->Atoms.size() == Values.size());
-  for (auto Tuple : zip_first(HdrData->Atoms, Values)) {
-    if (std::get<0>(Tuple).first == Atom)
-      return std::get<1>(Tuple);
-  }
+  for (auto [Atom, FormValue] : zip_equal(HdrData->Atoms, Values))
+    if (Atom.first == AtomToFind)
+      return FormValue;
   return std::nullopt;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152158.528424.patch
Type: text/x-patch
Size: 1216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230605/f95125ed/attachment.bin>


More information about the llvm-commits mailing list