Skip to content

Commit

Permalink
perf: reuse segment if it is a repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Oct 15, 2020
1 parent 47e4cb3 commit 4879010
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Assets/Mirror/Runtime/Transport/Kcp/Kcp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,12 @@ void InsertSegmentInReceiveBuffer(Segment newseg)
}
}

if (!repeat)
if (repeat)
{
// we already got this segment, put it back in the pool
Segment.Put(newseg);
}
else
{
if (insert_idx == n + 1)
receiveBuffer.Add(newseg);
Expand Down

0 comments on commit 4879010

Please sign in to comment.