fdutils/bpf.py
def _merge_range(self, list_to_merge):
        """ compares and compresses ranges

        :param list of Range:

        """
        s = sorted(list_to_merge, key=itemgetter(1))
        j = 0
        for i in range(len(list_to_merge) - 1):
            if s[j][1].overlaps(s[i + 1][1]) or s[j][1].is_contiguous_to(s[i + 1][1]):
                s[j][1].union_update(s[i + 1][1])
            else:
                j += 1
                s[j] = s[i + 1]
        for i, v in enumerate(s):
            list_to_merge[i] = v

        del list_to_merge[j + 1:]
 compares and compresses ranges

        :param list of Range:

        
compares and compresses ranges
:param list of Range.
compares and compresses ranges : param list of Range .
def _merge_range(self, list_to_merge):
        s = sorted(list_to_merge, key=itemgetter(1))
        j = 0
        for i in range(len(list_to_merge) - 1):
            if s[j][1].overlaps(s[i + 1][1]) or s[j][1].is_contiguous_to(s[i + 1][1]):
                s[j][1].union_update(s[i + 1][1])
            else:
                j += 1
                s[j] = s[i + 1]
        for i, v in enumerate(s):
            list_to_merge[i] = v
        del list_to_merge[j + 1:]
def _merge_range ( self , list_to_merge ) : s = sorted ( list_to_merge , key = itemgetter ( 1 ) ) j = 0 for i in range ( len ( list_to_merge ) - 1 ) : if s [ j ] [ 1 ] . overlaps ( s [ i + 1 ] [ 1 ] ) or s [ j ] [ 1 ] . is_contiguous_to ( s [ i + 1 ] [ 1 ] ) : s [ j ] [ 1 ] . union_update ( s [ i + 1 ] [ 1 ] ) else : j += 1 s [ j ] = s [ i + 1 ] for i , v in enumerate ( s ) : list_to_merge [ i ] = v del list_to_merge [ j + 1 : ]
compares and compresses ranges
:param list of Range:
compares and compresses ranges : param list of Range :
""" compares and compresses ranges

        :param list of Range:

        """
self
list_to_merge