Generate an optimised Python program to calculate the greatest common divisor (GCD) of two positive integers.
Not applicable
def gcd(x, y): 
    if x == 0: 
        return y 
    return gcd(y % x, x) 
  
# Driver code 
a = 8
b = 4
print("GCD of {0} and {1} is {2}".format(a, b, gcd(a, b)))