forked from quic-go/quic-go
fix typo in EntropyAccumulator function
This commit is contained in:
@@ -12,8 +12,8 @@ func (e *EntropyAccumulator) Add(packetNumber protocol.PacketNumber, entropyFlag
|
||||
}
|
||||
}
|
||||
|
||||
// Substract the contribution of the entropy flag of a given packet number
|
||||
func (e *EntropyAccumulator) Substract(packetNumber protocol.PacketNumber, entropyFlag bool) {
|
||||
// Subtract the contribution of the entropy flag of a given packet number
|
||||
func (e *EntropyAccumulator) Subtract(packetNumber protocol.PacketNumber, entropyFlag bool) {
|
||||
e.Add(packetNumber, entropyFlag)
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ var _ = Describe("EntropyAccumulator", func() {
|
||||
})
|
||||
})
|
||||
|
||||
Context("Substract", func() {
|
||||
Context("Subtract", func() {
|
||||
It("calculates the correct entropy", func() {
|
||||
var e1 EntropyAccumulator
|
||||
e1.Add(3, true)
|
||||
@@ -33,7 +33,7 @@ var _ = Describe("EntropyAccumulator", func() {
|
||||
var e2 EntropyAccumulator
|
||||
e2.Add(1, true)
|
||||
e2.Add(3, true)
|
||||
e2.Substract(1, true)
|
||||
e2.Subtract(1, true)
|
||||
|
||||
Expect(e1).To(Equal(e2))
|
||||
})
|
||||
|
||||
@@ -125,7 +125,7 @@ func (h *sentPacketHandler) calculateExpectedEntropy(ackFrame *frames.AckFrame)
|
||||
if !ok {
|
||||
return 0, ErrMapAccess
|
||||
}
|
||||
expectedEntropy.Substract(i, packet.EntropyBit)
|
||||
expectedEntropy.Subtract(i, packet.EntropyBit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user