Comment
Comment by feliperibeiro
This is the Euclidean algorithm for GCD, it's naive and simple. But if you see it more carefully, the commit that says "Optimized performance ..." contains just the lines:
to avoid the unnecessary repetitions if b is already the GCD