Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[core] fix crash error when erase event (#1940)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhan-he authored and YorkShen committed Dec 20, 2018
1 parent f41d1c2 commit 9148988
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -871,13 +871,13 @@ void CompareAndApplyEvents1(const std::string& page_id, VNode* old_node,

for (auto it = old_events.cbegin(); it != old_events.cend(); it++) {
auto pos = new_events.find(it->first);
if (pos == new_events.end()) {
if (pos != new_events.end()) {
new_events.erase(pos);
}
}
for (auto it = new_events.cbegin(); it != new_events.cend(); it++) {
auto pos = old_events.find(it->first);
if (pos == old_events.end()) {
if (pos != old_events.end()) {
old_events.erase(pos);
}
}
Expand All @@ -899,14 +899,14 @@ void CompareAndApplyEvents2(const std::string& page_id, VNode* old_node,
for (auto it = old_events.cbegin(); it != old_events.cend(); it++) {
auto pos = new_events.find(it->first);

if (pos == new_events.end()) {
if (pos != new_events.end()) {
new_events.erase(pos);
}
}
for (auto it = new_events.cbegin(); it != new_events.cend(); it++) {
auto pos = old_events.find(it->first);

if (pos == old_events.end()) {
if (pos != old_events.end()) {
old_events.erase(pos);
}
}
Expand Down

0 comments on commit 9148988

Please sign in to comment.