I was studying this fast Sieve of Eratosthenes generator and just wondered why, with the 'If check' of every item index, the code run faster than without this check. Who would think that!? Is it a trick to use in general?

```
import time    

def first(n):
    s=time.time()
    full_range = list(range(n))
    zeroes = [0] * n
    '''multiply n until sqrt(n)'''
    for r in range(2, int(n**.5) + 1):
        if full_range[r]:  ##HERE##
            full_range[2 * r:n:r] = zeroes[2 * r:n:r]   
    return list(filter(None, full_range)), print (time.time()-s)

def second(n):
    s=time.time()
    full_range = list(range(n))
    zeroes = [0] * n
    '''multiply n until sqrt(n)'''
    for r in range(2, int(n**.5) + 1):
        #if full_range[r]:   ##HERE##
        full_range[2 * r:n:r] = zeroes[2 * r:n:r]
    return list(filter(None, full_range)), print (time.time()-s)

print(first(100000) == second(100000))

First  0.3749978542327881 seconds
Second 0.9687492847442627 seconds
True

```