(self, other)
return result
This tries to implement anNSArray * N
    somewhat efficently (and definitely more
    efficient that repeated appending).
This tries to implement anNSArray * N
    somewhat efficently (and definitely more
    efficient that repeated appending).
This tries to implement anNSArray * N somewhat efficently ( and definitely more efficient that repeated appending ) .
def nsarray_mul(self, other):
    """
    This tries to implement anNSArray * N
    somewhat efficently (and definitely more
    efficient that repeated appending).
    """
    result = NSMutableArray.array()

    if other <= 0:
        return result

    n = 1
    tmp = self
    while other:
        if (other & n) != 0:
            result.addObjectsFromArray_(tmp)
            other -= n

        if other:
            n <<= 1
            tmp = tmp.arrayByAddingObjectsFromArray_(tmp)

    return result
def nsarray_mul ( self , other ) : result = NSMutableArray . array ( ) if other <= 0 : return result n = 1 tmp = self while other : if ( other & n ) != 0 : result . addObjectsFromArray_ ( tmp ) other -= n if other : n <<= 1 tmp = tmp . arrayByAddingObjectsFromArray_ ( tmp ) return result