From: Soeren Apel Date: Fri, 4 Nov 2016 17:00:08 +0000 (+0100) Subject: DecoderStack: Remove unneeded shared_ptr use X-Git-Tag: pulseview-0.4.0~224 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=caa4a2db5e100713818a353c17d2dc00fa475a2a;p=pulseview.git DecoderStack: Remove unneeded shared_ptr use --- diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index 6f1eb192..d01bab2d 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -191,9 +191,6 @@ void DecoderStack::clear() void DecoderStack::begin_decode() { - shared_ptr signalbase; - shared_ptr data; - if (decode_thread_.joinable()) { interrupt_ = true; input_cond_.notify_one(); @@ -242,10 +239,13 @@ void DecoderStack::begin_decode() // We get the logic data of the first channel in the list. // This works because we are currently assuming all // logic signals have the same data/segment + pv::data::SignalBase *signalbase; + pv::data::Logic *data; + for (const shared_ptr &dec : stack_) if (dec && !dec->channels().empty() && - ((signalbase = (*dec->channels().begin()).second)) && - ((data = signalbase->logic_data()))) + ((signalbase = (*dec->channels().begin()).second.get())) && + ((data = signalbase->logic_data().get()))) break; if (!data)