Skip to content

Commit 60912f9

Browse files
[ADT] Use structured bindings in CoalescingBitVector.h (NFC) (llvm#160976)
1 parent 9bf51b2 commit 60912f9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

llvm/include/llvm/ADT/CoalescingBitVector.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,7 @@ template <typename IndexT> class CoalescingBitVector {
194194

195195
// Delete the overlapping intervals. Split up intervals that only partially
196196
// intersect an overlap.
197-
for (IntervalT Overlap : Overlaps) {
198-
IndexT OlapStart, OlapStop;
199-
std::tie(OlapStart, OlapStop) = Overlap;
200-
197+
for (auto [OlapStart, OlapStop] : Overlaps) {
201198
auto It = Intervals.find(OlapStart);
202199
IndexT CurrStart = It.start();
203200
IndexT CurrStop = It.stop();
@@ -420,10 +417,7 @@ template <typename IndexT> class CoalescingBitVector {
420417
const SmallVectorImpl<IntervalT> &Overlaps,
421418
SmallVectorImpl<IntervalT> &NonOverlappingParts) {
422419
IndexT NextUncoveredBit = Start;
423-
for (IntervalT Overlap : Overlaps) {
424-
IndexT OlapStart, OlapStop;
425-
std::tie(OlapStart, OlapStop) = Overlap;
426-
420+
for (auto [OlapStart, OlapStop] : Overlaps) {
427421
// [Start;Stop] and [OlapStart;OlapStop] overlap iff OlapStart <= Stop
428422
// and Start <= OlapStop.
429423
bool DoesOverlap = OlapStart <= Stop && Start <= OlapStop;

0 commit comments

Comments
 (0)