Avoid extra copy and use more expressive APIs

Summary: changelog: [internal]

Reviewed By: RSNara

Differential Revision: D30756211

fbshipit-source-id: 650b3faa55ce1b6f33a452f25b699d854a5cee25
This commit is contained in:
Samuel Susla 2021-09-09 11:55:31 -07:00 коммит произвёл Facebook GitHub Bot
Родитель ba6f21e32d
Коммит 84d039aad2
1 изменённых файлов: 3 добавлений и 4 удалений

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

@ -256,13 +256,12 @@ LayoutAnimationKeyFrameManager::pullTransaction(
std::lock_guard<std::mutex> lock(currentAnimationMutex_);
if (currentAnimation_) {
currentAnimation = std::move(currentAnimation_);
currentAnimation_ = {};
currentAnimation_.reset();
}
}
if (currentAnimation) {
LayoutAnimation animation = std::move(currentAnimation.value());
currentAnimation = {};
if (currentAnimation.hasValue()) {
LayoutAnimation animation = std::move(currentAnimation).value();
animation.surfaceId = surfaceId;
animation.startTime = now;