diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-03-21 16:06:50 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-03-21 16:06:50 +0100 |
commit | b88f284107f7a37813ea093e3ab545d998cf9715 (patch) | |
tree | 670a981e93a7675e4328912b5031a0893670e6f3 /signal-composer-binding/clientApp.cpp | |
parent | a392191f554dce49f60b34acf40f658d9604b304 (diff) |
Linting improvments.
Uninitiliazed variable in submodule
Better handling of iterator assigments
Avoid multiple call to vector.size() function
Change-Id: I9cc8431e71b7d614a1619615a4048f19f5e31540
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/clientApp.cpp')
-rw-r--r-- | signal-composer-binding/clientApp.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/signal-composer-binding/clientApp.cpp b/signal-composer-binding/clientApp.cpp index da4bb72..854f96e 100644 --- a/signal-composer-binding/clientApp.cpp +++ b/signal-composer-binding/clientApp.cpp @@ -37,16 +37,19 @@ void clientAppCtx::appendSignals(std::vector<std::shared_ptr<Signal>>& sigV) for (std::vector<std::shared_ptr<Signal>>::const_iterator it = sigV.cbegin(); it != sigV.cend(); ++it) { + std::shared_ptr<Signal> sig = nullptr; for (auto& ctxSig: subscribedSignals_) {if(*it == ctxSig) {set = true;}} if (set) { set = false; sigV.erase(it); - continue; } - std::shared_ptr<Signal> sig = *it; - sig->addObserver(this); + else + { + std::shared_ptr<Signal> sig = *it; + sig->addObserver(this); + } } subscribedSignals_.insert(subscribedSignals_.end(), sigV.begin(), sigV.end()); |