Skip to content

Commit 3110a67

Browse files
sherginfacebook-github-bot
authored andcommitted
Fabric: Explicit clearing std::vector after moving from it
Summary: Apparently, the standard does not guarantee that the vector is empty after moving from it. So, let's clear it explicitly instead of asserting the emptiness. Reviewed By: sahrens Differential Revision: D12837227 fbshipit-source-id: 85dff6848707f4204f4c79be173064547e83c63e
1 parent 98685e8 commit 3110a67

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ReactCommon/fabric/events/EventBeatBasedExecutor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void EventBeatBasedExecutor::onBeat(bool success) const {
6262
}
6363

6464
tasks = std::move(tasks_);
65-
assert(tasks_.size() == 0);
65+
tasks_.clear();
6666
}
6767

6868
for (const auto task : tasks) {

ReactCommon/fabric/events/EventQueue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void EventQueue::onBeat() const {
3535
}
3636

3737
queue = std::move(queue_);
38-
assert(queue_.size() == 0);
38+
queue_.clear();
3939
}
4040

4141
{

0 commit comments

Comments
 (0)