Skip to content

Commit

Permalink
Fix VList's PartialEq.
Browse files Browse the repository at this point in the history
  • Loading branch information
futursolo committed Apr 3, 2023
1 parent 3db9ab0 commit 5670cea
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/yew/src/virtual_dom/vlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@ pub struct VList {

impl PartialEq for VList {
fn eq(&self, other: &Self) -> bool {
self.key == other.key
&& match (self.children.as_ref(), other.children.as_ref()) {
// We try to use ptr_eq if both are behind Rc,
// Somehow VNode is not Eq?
(Some(l), Some(r)) if Rc::ptr_eq(l, r) => true,
// We fallback to PartialEq if left and right didn't point to the same memory
// address.
(l, r) => l == r,
}
self.key == other.key && self.children == other.children
}
}

Expand Down

0 comments on commit 5670cea

Please sign in to comment.