Skip to content

Commit

Permalink
compute peerCount using ixset's size function
Browse files Browse the repository at this point in the history
Should be faster than using the Foldable `length` because it's using
the default impl
  • Loading branch information
edmundnoble committed Nov 13, 2024
1 parent 19f7d63 commit 9a95738
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/P2P/Node.hs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ findNextPeer conf node = do
--
peers <- peerDbSnapshotSTM peerDbVar
!sessions <- readTVar sessionsVar
let peerCount = length peers
let peerCount = IXS.size peers
let sessionCount = M.size sessions

-- Check that there are peers
Expand Down

0 comments on commit 9a95738

Please sign in to comment.