]> sigrok.org Git - pulseview.git/commitdiff
DecoderStack: Remove unneeded shared_ptr use
authorSoeren Apel <redacted>
Fri, 4 Nov 2016 17:00:08 +0000 (18:00 +0100)
committerSoeren Apel <redacted>
Sun, 4 Dec 2016 13:37:38 +0000 (14:37 +0100)
pv/data/decoderstack.cpp

index 6f1eb1925dc3e34fe59e35e3343cb5f0e93e7fd0..d01bab2de111b155c9880ecf72a4fd3806316e62 100644 (file)
@@ -191,9 +191,6 @@ void DecoderStack::clear()
 
 void DecoderStack::begin_decode()
 {
-       shared_ptr<pv::data::SignalBase> signalbase;
-       shared_ptr<pv::data::Logic> 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<decode::Decoder> &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)