diff --git a/lib/ngtcp2_rtb.c b/lib/ngtcp2_rtb.c index bbbea2d8dbb41d9d209acfde70d00600ab5f4d51..cd8585e230537b2e4540b52733d5e76b89abc0c5 100644 --- a/lib/ngtcp2_rtb.c +++ b/lib/ngtcp2_rtb.c @@ -143,19 +143,6 @@ void ngtcp2_frame_chain_list_del(ngtcp2_frame_chain *frc, } } -static void frame_chain_insert(ngtcp2_frame_chain **pfrc, - ngtcp2_frame_chain *frc) { - ngtcp2_frame_chain **plast; - - assert(frc); - - for (plast = &frc; *plast; plast = &(*plast)->next) - ; - - *plast = *pfrc; - *pfrc = frc; -} - int ngtcp2_frame_chain_binder_new(ngtcp2_frame_chain_binder **pbinder, const ngtcp2_mem *mem) { *pbinder = ngtcp2_mem_calloc(mem, 1, sizeof(ngtcp2_frame_chain_binder)); @@ -435,7 +422,10 @@ static int rtb_reclaim_frame(ngtcp2_rtb *rtb, int *preclaimed, } *preclaimed = 1; - frame_chain_insert(pfrc, nfrc); + + nfrc->next = *pfrc; + *pfrc = nfrc; + pfrc = &nfrc->next; } return 0;