-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kad: Avoid cloning the
KademliaMessage
and use reference for `Routi…
…ngTable::closest` (#233) This PR brings a few optimizations wrt cloning objects and improves the ergonomics of the routing table API: - `KademliaMessage` is moved by value to avoid further cloning of references - kademlia keys are constructed from borrowed references - `RoutingTable::closest` takes the provided key by reference for better ergonomics. One use-case for references is when the key is later on used for other purposes (like computing distances) cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
- Loading branch information
Showing
2 changed files
with
51 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters