The patch optimizes this case by converting the cached reference from a sequence number to a pointer to the highest packet in the queue that has been SACKed in the past.
Applying structure pointer and dynamic data structure, such as the linked list and queue in c, we have made the working software executed with less memory requirement and time overhead.
Removing an entry from the queue involves extracting the entry pointed to by the head pointer and then adjusting the head pointer to point toward the entry that followed the removed entry.