def _removeUltrashortIntervals(tier, minLength, minTimestamp):
    """
    Remove intervals that are very tiny
    
    Doing many small manipulations on intervals can lead to the creation
    of ultrashort intervals (e.g. 1*10^-15 seconds long).  This function
    removes such intervals.
    """
    newEntryList = []
    j = 0
    for start, stop, label in tier.entryList:
        if stop - start < minLength:
            if len(newEntryList) > 0:
                lastStart, _, lastLabel = newEntryList[j - 1]
                newEntryList[j - 1] = lastStart, stop, lastLabel
        else:
            if len(newEntryList) == 0 and start != minTimestamp:
                newEntryList.append((minTimestamp, stop, label))
            else:
                newEntryList.append((start, stop, label))
            j += 1
    j = 0
    while j < len(newEntryList) - 1:
        diff = abs(newEntryList[j][1] - newEntryList[j + 1][0])
        if diff > 0 and diff < minLength:
            newEntryList[j] = newEntryList[j][0], newEntryList[j + 1][0
                ], newEntryList[j][2]
        j += 1
    return tier.new(entryList=newEntryList)
