The patch optimizes this case by converting the cached reference from a sequencenumber to a pointer to the highest packet in the queue that has been SACKed in the past.
If the source address and sequencenumber of a newly received packet matches that of a previously received packet, then the newly received packet is a duplicate and may be dumped.