Skip to content

Commit

Permalink
perf: remove needless node clone in 'TreeSync::from_ratchet_tree'
Browse files Browse the repository at this point in the history
  • Loading branch information
beltram committed Jan 8, 2024
1 parent 30714b6 commit 2863e79
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions openmls/src/treesync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,7 @@ impl TreeSync {
// Set the leaf indices in all the leaves and convert the node types.
for (node_index, node_option) in ratchet_tree.0.into_iter().enumerate() {
let ts_node_option: TreeNode<TreeSyncLeafNode, TreeSyncParentNode> = match node_option {
Some(node) => {
let node = node.clone();
TreeSyncNode::from(node).into()
}
Some(node) => TreeSyncNode::from(node).into(),
None => {
if node_index % 2 == 0 {
TreeNode::Leaf(TreeSyncLeafNode::blank())
Expand Down

0 comments on commit 2863e79

Please sign in to comment.