From: Soeren Apel Date: Tue, 16 Feb 2016 20:14:41 +0000 (+0100) Subject: DecodeTrace: Optimize loop (see also da50281d) X-Git-Tag: pulseview-0.4.0~333 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4fb5fb99ba0453af3080e82e4f3e2f295a55616b;p=pulseview.git DecodeTrace: Optimize loop (see also da50281d) --- diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index e5b84f99..6bafa11e 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -199,9 +199,7 @@ void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp) const vector rows(decoder_stack_->get_visible_rows()); visible_rows_.clear(); - for (auto i : rows) { - const Row &row = i; - + for (const Row& row : rows) { // Cache the row title widths int row_title_width; try { @@ -229,7 +227,7 @@ void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp) y += row_height_; - visible_rows_.push_back(i); + visible_rows_.push_back(row); } }