Remove redundant parameter from ShadowTreeRegistry::enumerate

Summary:
Changelog: [internal]

Nothing was using `stop` parameter, let's get rid of it.

Reviewed By: philIip

Differential Revision: D32669018

fbshipit-source-id: dc2d52048a2f7dd3785dd959270087001c778962
This commit is contained in:
Samuel Susla 2021-11-30 04:26:16 -08:00 коммит произвёл Facebook GitHub Bot
Родитель fab4752e1f
Коммит a9815286c2
4 изменённых файлов: 8 добавлений и 15 удалений

Просмотреть файл

@ -53,15 +53,10 @@ bool ShadowTreeRegistry::visit(
} }
void ShadowTreeRegistry::enumerate( void ShadowTreeRegistry::enumerate(
std::function<void(const ShadowTree &shadowTree, bool &stop)> callback) std::function<void(const ShadowTree &shadowTree)> callback) const {
const {
std::shared_lock<better::shared_mutex> lock(mutex_); std::shared_lock<better::shared_mutex> lock(mutex_);
bool stop = false;
for (auto const &pair : registry_) { for (auto const &pair : registry_) {
callback(*pair.second, stop); callback(*pair.second);
if (stop) {
break;
}
} }
} }

Просмотреть файл

@ -54,11 +54,10 @@ class ShadowTreeRegistry final {
/* /*
* Enumerates all stored shadow trees. * Enumerates all stored shadow trees.
* Set `stop` to `true` to interrupt the enumeration.
* Can be called from any thread. * Can be called from any thread.
*/ */
void enumerate(std::function<void(const ShadowTree &shadowTree, bool &stop)> void enumerate(
callback) const; std::function<void(const ShadowTree &shadowTree)> callback) const;
private: private:
mutable better::shared_mutex mutex_; mutable better::shared_mutex mutex_;

Просмотреть файл

@ -143,7 +143,7 @@ Scheduler::~Scheduler() {
// Then, let's verify that the requirement was satisfied. // Then, let's verify that the requirement was satisfied.
auto surfaceIds = std::vector<SurfaceId>{}; auto surfaceIds = std::vector<SurfaceId>{};
uiManager_->getShadowTreeRegistry().enumerate( uiManager_->getShadowTreeRegistry().enumerate(
[&](ShadowTree const &shadowTree, bool &stop) { [&surfaceIds](ShadowTree const &shadowTree) {
surfaceIds.push_back(shadowTree.getSurfaceId()); surfaceIds.push_back(shadowTree.getSurfaceId());
}); });

Просмотреть файл

@ -449,10 +449,9 @@ void UIManager::stopSurfaceForAnimationDelegate(SurfaceId surfaceId) const {
void UIManager::animationTick() { void UIManager::animationTick() {
if (animationDelegate_ != nullptr && if (animationDelegate_ != nullptr &&
animationDelegate_->shouldAnimateFrame()) { animationDelegate_->shouldAnimateFrame()) {
shadowTreeRegistry_.enumerate( shadowTreeRegistry_.enumerate([](ShadowTree const &shadowTree) {
[&](ShadowTree const &shadowTree, bool &stop) { shadowTree.notifyDelegatesOfUpdates();
shadowTree.notifyDelegatesOfUpdates(); });
});
} }
} }