'Search the list for the position of the split point for |code|,
inserting a new split point if necessary. Returns index |i| such
that |code| == |map[i]|.'

def split(self, code, len=len, maxint=maxint):

    map = self.map
    hi = (len(map) - 1)
    if (code == maxint):
        return hi
    lo = 0
    while ((hi - lo) >= 4):
        mid = (((lo + hi) // 2) & (~ 1))
        if (code < map[mid]):
            hi = mid
        else:
            lo = mid
    if (map[lo] == code):
        return lo
    else:
        map[hi:hi] = [code, map[(hi - 1)].copy()]
        return hi
