From b25d860be4025dec88df8f1c1cf2032eb64ff9fe Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 28 Jul 2015 10:36:19 -0700 Subject: [PATCH] Remove seqcmp --- libraries/networking/src/udt/CongestionControl.cpp | 2 +- libraries/networking/src/udt/SeqNum.cpp | 5 ----- libraries/networking/src/udt/SeqNum.h | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/libraries/networking/src/udt/CongestionControl.cpp b/libraries/networking/src/udt/CongestionControl.cpp index 4f32be0d06..a75f62bb5f 100644 --- a/libraries/networking/src/udt/CongestionControl.cpp +++ b/libraries/networking/src/udt/CongestionControl.cpp @@ -106,7 +106,7 @@ void UdtCC::onLoss(const std::vector& losslist) { _loss = true; - if (seqcmp(losslist[0], _lastDecSeq) > 0) { + if (losslist[0] > _lastDecSeq) { _lastDecPeriod = _packetSendPeriod; _packetSendPeriod = ceil(_packetSendPeriod * 1.125); diff --git a/libraries/networking/src/udt/SeqNum.cpp b/libraries/networking/src/udt/SeqNum.cpp index 506b8bf3c9..1e853bf4f3 100644 --- a/libraries/networking/src/udt/SeqNum.cpp +++ b/libraries/networking/src/udt/SeqNum.cpp @@ -11,11 +11,6 @@ #include "SeqNum.h" -int udt::seqcmp(const SeqNum& seq1, const SeqNum& seq2) { - return (glm::abs(seq1._value - seq2._value) < SeqNum::THRESHOLD) ? (seq1._value - seq2._value) - : (seq2._value - seq1._value); -} - int udt::seqlen(const SeqNum& seq1, const SeqNum& seq2) { return (seq1._value <= seq2._value) ? (seq2._value - seq1._value + 1) : (seq2._value - seq1._value + SeqNum::MAX + 2); diff --git a/libraries/networking/src/udt/SeqNum.h b/libraries/networking/src/udt/SeqNum.h index 5ae85f3dcf..90b327e4c9 100644 --- a/libraries/networking/src/udt/SeqNum.h +++ b/libraries/networking/src/udt/SeqNum.h @@ -84,7 +84,6 @@ public: friend SeqNum operator-(const SeqNum a, const Type& b); friend SeqNum operator-(const Type& a, const SeqNum b); - friend int seqcmp(const SeqNum& seq1, const SeqNum& seq2); friend int seqlen(const SeqNum& seq1, const SeqNum& seq2); friend int seqoff(const SeqNum& seq1, const SeqNum& seq2); @@ -132,7 +131,6 @@ inline SeqNum operator-(const SeqNum::Type& a, SeqNum b) { return b; } -int seqcmp(const SeqNum& seq1, const SeqNum& seq2); int seqlen(const SeqNum& seq1, const SeqNum& seq2); int seqoff(const SeqNum& seq1, const SeqNum& seq2);