Skip to content

Commit

Permalink
Code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
cecton committed Nov 6, 2023
1 parent 0a9a3bc commit d7e4acf
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions packages/yew/src/virtual_dom/vlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,9 @@ impl VList {

/// Creates a new [VList] instance with children.
pub fn with_children(children: Vec<VNode>, key: Option<Key>) -> Self {
if children.is_empty() {
VList {
fully_keyed: FullyKeyedState::KnownFullyKeyed,
children: None,
key,
}
} else {
let mut vlist = VList {
fully_keyed: FullyKeyedState::Unknown,
children: Some(Rc::new(children)),
key,
};
vlist.recheck_fully_keyed();
vlist
}
let mut vlist = VList::from(children);
vlist.key = key;
vlist
}

// Returns a mutable reference to children, allocates the children if it hasn't been done.
Expand Down

0 comments on commit d7e4acf

Please sign in to comment.