mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 22:24:26 +00:00
preen
This commit is contained in:
@@ -17,13 +17,13 @@ void ComponentIterator::begin(bool include_internal) {
|
||||
this->include_internal_ = include_internal;
|
||||
}
|
||||
|
||||
template<typename Container>
|
||||
void ComponentIterator::process_platform_item_(const Container &items,
|
||||
bool (ComponentIterator::*on_item)(typename Container::value_type)) {
|
||||
template<typename PlatformItem>
|
||||
void ComponentIterator::process_platform_item_(const std::vector<PlatformItem *> &items,
|
||||
bool (ComponentIterator::*on_item)(PlatformItem *)) {
|
||||
if (this->at_ >= items.size()) {
|
||||
this->advance_platform_();
|
||||
} else {
|
||||
auto *item = items[this->at_];
|
||||
PlatformItem *item = items[this->at_];
|
||||
if ((item->is_internal() && !this->include_internal_) || (this->*on_item)(item)) {
|
||||
this->at_++;
|
||||
}
|
||||
|
||||
@@ -172,9 +172,9 @@ class ComponentIterator {
|
||||
uint16_t at_{0}; // Supports up to 65,535 entities per type
|
||||
bool include_internal_{false};
|
||||
|
||||
template<typename Container>
|
||||
void process_platform_item_(const Container &items,
|
||||
bool (ComponentIterator::*on_item)(typename Container::value_type));
|
||||
template<typename PlatformItem>
|
||||
void process_platform_item_(const std::vector<PlatformItem *> &items,
|
||||
bool (ComponentIterator::*on_item)(PlatformItem *));
|
||||
void advance_platform_();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user