Skip to content

Commit

Permalink
perf: remove allocation
Browse files Browse the repository at this point in the history
recycle segment in kcp
  • Loading branch information
paulpach committed Oct 15, 2020
1 parent a31b2bc commit 9311fbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Assets/Mirror/Runtime/Transport/Kcp/Kcp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ void ParseData(Segment newseg)
{
uint sn = newseg.sn;
if (sn >= rcv_nxt + ReceiveWindowMax || sn < rcv_nxt)
{
Segment.Put(newseg);
return;
}

InsertSegmentInReceiveBuffer(newseg);
MoveToReceiveQueue();
Expand Down

0 comments on commit 9311fbd

Please sign in to comment.