]> sigrok.org Git - pulseview.git/blobdiff - pv/view/decodetrace.cpp
Use range-based for loops more often.
[pulseview.git] / pv / view / decodetrace.cpp
index 95e0e5e9ef0f2d4ddfd0692da1ab478846351190..b2ead1a66848600e1ae11425fe874d708b73f39a 100644 (file)
@@ -199,8 +199,8 @@ void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
        const vector<Row> rows(decoder_stack_->get_visible_rows());
 
        visible_rows_.clear();
        const vector<Row> rows(decoder_stack_->get_visible_rows());
 
        visible_rows_.clear();
-       for (size_t i = 0; i < rows.size(); i++) {
-               const Row &row = rows[i];
+       for (auto i : rows) {
+               const Row &row = i;
 
                // Cache the row title widths
                int row_title_width;
 
                // Cache the row title widths
                int row_title_width;
@@ -229,7 +229,7 @@ void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
 
                        y += row_height_;
 
 
                        y += row_height_;
 
-                       visible_rows_.push_back(rows[i]);
+                       visible_rows_.push_back(i);
                }
        }
 
                }
        }