About optimised union_set function

initially all rank of sets are 1.So how will the union_set function start working for the 1st time as we are initialising the ranks of all sets =1 beforehand.in the Union set function we are checking the condition and merging only if ranks of two sets are different. what if the ranks are same?