def _remove_duplicate_links(links):
    # type: (Iterable[Link]) -> List[Link]
    """
    Return a list of links, with duplicates removed and ordering preserved.
    """
    # We preserve the ordering when removing duplicates because we can.
    return list(OrderedDict.fromkeys(links))

    Return a list of links, with duplicates removed and ordering preserved.
    
product/gradle-plugin/src/main/python/pip/_internal/index/collector.py