Commit 8df670f5 authored by Dominik Charousset's avatar Dominik Charousset

Remove dead code

parent 86d0fb7e
...@@ -101,14 +101,7 @@ public: ...@@ -101,14 +101,7 @@ public:
void fwd_on_error(input_key key, const error& what) { void fwd_on_error(input_key key, const error& what) {
if (key == active_key_ || key == factory_key_) { if (key == active_key_ || key == factory_key_) {
CAF_ASSERT(out_); CAF_ASSERT(out_);
if (delay_error_) { fin(&what);
if (!err_)
err_ = what;
subscribe_next();
} else {
err_ = what;
fin();
}
} }
} }
...@@ -137,7 +130,6 @@ public: ...@@ -137,7 +130,6 @@ public:
if (out_) { if (out_) {
ctx_->delay_fn([strong_this = intrusive_ptr<concat_sub>{this}] { ctx_->delay_fn([strong_this = intrusive_ptr<concat_sub>{this}] {
if (strong_this->out_) { if (strong_this->out_) {
strong_this->err_.reset();
strong_this->fin(); strong_this->fin();
} }
}); });
...@@ -152,7 +144,7 @@ public: ...@@ -152,7 +144,7 @@ public:
} }
private: private:
void fin() { void fin(const error* err = nullptr) {
CAF_ASSERT(out_); CAF_ASSERT(out_);
if (factory_sub_) { if (factory_sub_) {
factory_sub_.dispose(); factory_sub_.dispose();
...@@ -164,8 +156,8 @@ private: ...@@ -164,8 +156,8 @@ private:
} }
factory_key_ = 0; factory_key_ = 0;
active_key_ = 0; active_key_ = 0;
if (err_) if (err)
out_.on_error(err_); out_.on_error(*err);
else else
out_.on_complete(); out_.on_complete();
out_ = nullptr; out_ = nullptr;
...@@ -177,12 +169,6 @@ private: ...@@ -177,12 +169,6 @@ private:
/// Stores a handle to the subscribed observer. /// Stores a handle to the subscribed observer.
observer<T> out_; observer<T> out_;
/// Configures whether we carry on after an error.
bool delay_error_ = false;
/// Caches an on_error reason if delay_error_ is true.
error err_;
/// Stores our input sources. The first input is active (subscribed to) while /// Stores our input sources. The first input is active (subscribed to) while
/// the others are pending (not subscribed to). /// the others are pending (not subscribed to).
std::vector<input_type> inputs_; std::vector<input_type> inputs_;
...@@ -245,13 +231,8 @@ private: ...@@ -245,13 +231,8 @@ private:
template <class Input> template <class Input>
void add(Input&& x) { void add(Input&& x) {
using input_t = std::decay_t<Input>; using input_t = std::decay_t<Input>;
if constexpr (detail::is_iterable_v<input_t>) { static_assert(is_observable_v<input_t>);
for (auto& in : x) inputs_.emplace_back(std::move(x).as_observable());
add(in);
} else {
static_assert(is_observable_v<input_t>);
inputs_.emplace_back(std::move(x).as_observable());
}
} }
std::vector<input_type> inputs_; std::vector<input_type> inputs_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment