Skip to content

Commit

Permalink
ParseFastack: TimeDiff calls simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
mischa committed May 11, 2023
1 parent e3b422b commit 9eebfc3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kcp2k/Assets/kcp2k/kcp/Kcp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,19 @@ internal void ParseFastack(uint sn, uint ts) // serial number, timestamp
{
// sn needs to be between snd_una and snd_nxt
// if !(snd_una <= sn && sn < snd_nxt) return;
if (Utils.TimeDiff(sn, snd_una) < 0)

// if (Utils.TimeDiff(sn, snd_una) < 0)
if (sn < snd_una)
return;

if (Utils.TimeDiff(sn, snd_nxt) >= 0)
// if (Utils.TimeDiff(sn, snd_nxt) >= 0)
if (sn >= snd_nxt)
return;

foreach (Segment seg in snd_buf)
{
if (Utils.TimeDiff(sn, seg.sn) < 0)
// if (Utils.TimeDiff(sn, seg.sn) < 0)
if (sn < seg.sn)
{
break;
}
Expand Down

0 comments on commit 9eebfc3

Please sign in to comment.