File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
examples/dataflow/lib/Analysis Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -253,19 +253,19 @@ public:
253253 // into the current lattice element for all of our results.`results` stores
254254 // the lattices corresponding to the results of op, We use a loop to traverse
255255 // them.
256- for (int i = 0, e = results.size(); i < e; ++i ) {
256+ for (auto result : results) {
257257
258258 // `isChanged` records whether the result has been changed.
259259 ChangeResult isChanged = ChangeResult::NoChange;
260260
261261 // Op's metadata is joined result's lattice.
262- isChanged |= results[i] ->join(latticeValue);
262+ isChanged |= result ->join(latticeValue);
263263
264264 // All lattice of operands of op are joined to the lattice of result.
265- for (int j = 0, m = operands.size(); j < m; ++j) {
266- isChanged |= results[i] ->join(*operands[j] );
267- }
268- propagateIfChanged(results[i] , isChanged);
265+ for (auto operand : operands)
266+ isChanged |= result ->join(*operand );
267+
268+ propagateIfChanged(result , isChanged);
269269 }
270270 return success();
271271 }
Original file line number Diff line number Diff line change @@ -90,19 +90,19 @@ LogicalResult MetadataAnalysis::visitOperation(
9090 // into the current lattice element for all of our results.`results` stores
9191 // the lattices corresponding to the results of op, We use a loop to traverse
9292 // them.
93- for (int i = 0 , e = results. size (); i < e; ++i ) {
93+ for (auto result : results) {
9494
9595 // `isChanged` records whether the result has been changed.
9696 ChangeResult isChanged = ChangeResult::NoChange;
9797
9898 // Op's metadata is joined result's lattice.
99- isChanged |= results[i] ->join (latticeValue);
99+ isChanged |= result ->join (latticeValue);
100100
101101 // All lattice of operands of op are joined to the lattice of result.
102- for (int j = 0 , m = operands. size (); j < m; ++j) {
103- isChanged |= results[i] ->join (*operands[j] );
104- }
105- propagateIfChanged (results[i] , isChanged);
102+ for (auto operand : operands)
103+ isChanged |= result ->join (*operand );
104+
105+ propagateIfChanged (result , isChanged);
106106 }
107107 return success ();
108108}
You can’t perform that action at this time.
0 commit comments