Skip to content

Commit

Permalink
update transaction_outputs (MystenLabs#20456)
Browse files Browse the repository at this point in the history
## Description 

1. **`possible_to_receive.iter().clone()` ->
`possible_to_receive.into_iter()`**:

This modification is generally appropriate and improves performance by
avoiding unnecessary cloning of the `possible_to_receive` collection.
Instead of cloning, it consumes the iterator, which is more efficient.

2. **` .chain(received_objects)` -> `
.chain(received_objects.into_iter())`**:

By calling `into_iter()` on `received_objects` when adding them to
`locks_to_delete`, the objects are directly used in the collection and
the original reference to `received_objects` is no longer necessary.

3. ** Correct the spelling error in `transaction_orchestrator`**:

`fnished` -> `finished`

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:

---------

Co-authored-by: stefan-mysten <[email protected]>
  • Loading branch information
xiaodi007 and stefan-mysten authored Jan 7, 2025
1 parent b9f7d3c commit a0b5616
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/sui-core/src/transaction_outputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ impl TransactionOutputs {
let modified_at: HashSet<_> = effects.modified_at_versions().into_iter().collect();
let possible_to_receive = transaction.transaction_data().receiving_objects();
let received_objects = possible_to_receive
.iter()
.cloned()
.into_iter()
.filter(|obj_ref| modified_at.contains(&(obj_ref.0, obj_ref.1)));

// We record any received or deleted objects since they could be pruned, and smear shared
Expand Down

0 comments on commit a0b5616

Please sign in to comment.