X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fanalogsignal.cpp;h=3fda4cb6251de1d95326288b19eeb1ae949e1480;hp=5b3241d2d35beb1aa4a552743aff00705d5319ac;hb=f4ab4b5c657e5613caba82feaa81a8a400e4f331;hpb=099d231771d9ff6230218dbe9835a03876f0e856 diff --git a/pv/views/trace/analogsignal.cpp b/pv/views/trace/analogsignal.cpp index 5b3241d..3fda4cb 100644 --- a/pv/views/trace/analogsignal.cpp +++ b/pv/views/trace/analogsignal.cpp @@ -614,10 +614,11 @@ void AnalogSignal::paint_logic_mid(QPainter &p, ViewItemPaintParams &pp) if (fill_high_areas) { // Any edge terminates a high area - const int width = x - rising_edge_x; - if (rising_edge_seen && (width > 0)) { - high_rects.emplace_back(rising_edge_x, high_offset, - width, signal_height); + if (rising_edge_seen) { + const int width = x - rising_edge_x; + if (width > 0) + high_rects.emplace_back(rising_edge_x, high_offset, + width, signal_height); rising_edge_seen = false; } @@ -787,7 +788,7 @@ void AnalogSignal::update_conversion_widgets() conv_threshold_cb_->blockSignals(true); // Set available options depending on chosen conversion - for (pair preset : presets) + for (pair& preset : presets) conv_threshold_cb_->addItem(preset.first, preset.second); map < QString, QVariant > options = base_->get_conversion_options(); @@ -856,7 +857,7 @@ void AnalogSignal::perform_autoranging(bool keep_divs, bool force_update) static double prev_min = 0, prev_max = 0; double min = 0, max = 0; - for (shared_ptr segment : segments) { + for (const shared_ptr& segment : segments) { pair mm = segment->get_min_max(); min = std::min(min, mm.first); max = std::max(max, mm.second);