mirror of
https://github.com/esphome/esphome.git
synced 2026-09-16 01:28:39 +00:00
[core] Restore play_complex overrides for LambdaAction and ContinuationAction
The +384 flash was from the always_inline attributes (already removed), not from the play_complex overrides.
This commit is contained in:
@@ -217,6 +217,13 @@ template<typename... Ts> class LambdaAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit LambdaAction(std::function<void(Ts...)> &&f) : f_(std::move(f)) {}
|
||||
|
||||
// Override play_complex to call play() non-virtually (qualified call),
|
||||
// eliminating one virtual dispatch frame from the call stack.
|
||||
void play_complex(const Ts &...x) override {
|
||||
this->num_running_++;
|
||||
LambdaAction::play(x...);
|
||||
this->play_next_(x...);
|
||||
}
|
||||
void play(const Ts &...x) override { this->f_(x...); }
|
||||
|
||||
protected:
|
||||
@@ -250,6 +257,13 @@ template<typename... Ts> class ContinuationAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit ContinuationAction(Action<Ts...> *parent) : parent_(parent) {}
|
||||
|
||||
// Override play_complex to call play() non-virtually (qualified call),
|
||||
// eliminating one virtual dispatch frame from the call stack.
|
||||
void play_complex(const Ts &...x) override {
|
||||
this->num_running_++;
|
||||
ContinuationAction::play(x...);
|
||||
this->play_next_(x...);
|
||||
}
|
||||
void play(const Ts &...x) override { this->parent_->play_next_(x...); }
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user