From d1a3d14cf17f70b380746fe7b8b192f2c3938850 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 2 May 2016 16:36:48 +0700 Subject: [PATCH] fix typo in EntropyAccumulator function --- ackhandler/entropy_accumulator.go | 4 ++-- ackhandler/entropy_accumulator_test.go | 4 ++-- ackhandler/sent_packet_handler.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ackhandler/entropy_accumulator.go b/ackhandler/entropy_accumulator.go index 98a86740..9dff6e43 100644 --- a/ackhandler/entropy_accumulator.go +++ b/ackhandler/entropy_accumulator.go @@ -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) } diff --git a/ackhandler/entropy_accumulator_test.go b/ackhandler/entropy_accumulator_test.go index 02813c67..b5556328 100644 --- a/ackhandler/entropy_accumulator_test.go +++ b/ackhandler/entropy_accumulator_test.go @@ -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)) }) diff --git a/ackhandler/sent_packet_handler.go b/ackhandler/sent_packet_handler.go index f42dc4a6..db30c5ba 100644 --- a/ackhandler/sent_packet_handler.go +++ b/ackhandler/sent_packet_handler.go @@ -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) } } }