fix typo in EntropyAccumulator function

This commit is contained in:
Marten Seemann
2016-05-02 16:36:48 +07:00
parent ad467ade58
commit d1a3d14cf1
3 changed files with 5 additions and 5 deletions

View File

@@ -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)
}

View File

@@ -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))
})

View File

@@ -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)
}
}
}