Two identical loops were iterating over different ranges, leading to code
duplication. We replace this by a loop over the concatenation of the ranges.
We also use early returns to avoid deeply nested code.
Paths
| Differential D154505
[lldb][NFC] Remove code duplication in InitOSO ClosedPublic Authored by fdeazeve on Jul 5 2023, 5:47 AM.
Details
Summary Two identical loops were iterating over different ranges, leading to code We also use early returns to avoid deeply nested code.
Diff Detail
Event TimelineComment Actions I'm a big fan of refactoring deeply-nested code to be flatter, so I'm happy to see this work being done! I wasn't aware of llvm::concat before, I probably would have used a lambda or something to do this, so it was interesting learning about that. 😄
Comment Actions
+1 on both accounts. LGTM modulo the comment. This revision is now accepted and ready to land.Jul 5 2023, 9:13 AM
Closed by commit rG7cea22c0be95: [lldb][NFC] Remove code duplication in InitOSO (authored by fdeazeve). · Explain WhyJul 6 2023, 5:20 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 537672 lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
|
Besides the typo, is this comment correct? We're not verifying the claim in the comment AFAICT.