if condition and && operation time reduction question

This is the process of Merge sorting.
I changed the code above to the code below.

while (!done)
			{
				if ((index1 == endIndex1) && (index2 < endIndex2))
					temp[targetIndex++] = a[index2++];

				else if ((index2 == endIndex2) && (index1 < endIndex1))
					temp[targetIndex++] = a[index1++];

				else if (a[index1] < a[index2])
					temp[targetIndex++] = a[index1++];

				else
					temp[targetIndex++] = a[index2++];

				if ((index1 == endIndex1) && (index2 == endIndex2))
					done = 1;

			}
while (!done)
			{
				if (index1 == endIndex1) {
					if (index2 < endIndex2) {
						temp[targetIndex++] = a[index2++];
					}
					
				}
				else if (index2 == endIndex2) {
					if (index1 < endIndex1)
					{
						temp[targetIndex++] = a[index1++];
					}
				}
				else if (a[index1] < a[index2])
					temp[targetIndex++] = a[index1++];

				else
					temp[targetIndex++] = a[index2++];

				if (index1 == endIndex1)
				{
					if (index2 == endIndex2) {
						done = 1;
					}
					else done = 0;
				}
			
			}

I noticed a time difference when I changed my coding to try Divergent Branching Practice.

In the process of executing 500,000 sorts

After removing && and using if twice, the time was reduced from 2120ms to 1880ms.

I wonder why this reduced time. Is it related to Divergent Branching and warp ?