@staticmethod
def _sortedSetAdd(list, element):
    """
        Insert element into the list, sorted using element.compare(). If it is a
        duplicate of an existing list element, don't add it.
        """
    i = 0
    while i < len(list):
        comparison = list[i].compare(element)
        if comparison == 0:
            return
        if not comparison < 0:
            break
        i += 1
    list.insert(i, element)
