Skip to content

Commit

Permalink
perf(p2p): Remove unnecessary atomic read (backport cometbft#2950) (c…
Browse files Browse the repository at this point in the history
…ometbft#2972)

This PR is a driveby change. We were doing an atomic read here, but this
is unnecessary. Nothing in the codebase modified this variable after
instantiation.

Doesn't really feel changelog worthy, but I can add one if we want. Felt
like a minor code nit<hr>This is an automatic backport of pull request
cometbft#2950 done by [Mergify](https://mergify.com).

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
  • Loading branch information
2 people authored and czarcas7ic committed May 2, 2024
1 parent 08efc4c commit dca19ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/conn/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (c *MConnection) sendSomePacketMsgs() bool {
// Block until .sendMonitor says we can write.
// Once we're ready we send more than we asked for,
// but amortized it should even out.
c.sendMonitor.Limit(c._maxPacketMsgSize, atomic.LoadInt64(&c.config.SendRate), true)
c.sendMonitor.Limit(c._maxPacketMsgSize, c.config.SendRate, true)

// Now send some PacketMsgs.
for i := 0; i < numBatchPacketMsgs; i++ {
Expand Down

0 comments on commit dca19ae

Please sign in to comment.