Skip to content

Commit

Permalink
refactor: simplify an Entry operation
Browse files Browse the repository at this point in the history
Signed-off-by: ljedrz <[email protected]>
  • Loading branch information
ljedrz committed Apr 5, 2023
1 parent f875596 commit 03bfb83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion node/router/src/helpers/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl<N: Network> Sync<N> {
self.locators.read().iter().map(|(peer_ip, locators)| (locators.latest_locator_height(), *peer_ip)).fold(
Default::default(),
|mut map, (height, peer_ip)| {
map.entry(height).or_insert_with(Vec::new).push(peer_ip);
map.entry(height).or_default().push(peer_ip);
map
},
)
Expand Down

0 comments on commit 03bfb83

Please sign in to comment.