mercurial/bdiff.c
branchstable
changeset 29010 e868d8ee7c8f
parent 19962 66b21ce60a19
child 29011 8bcda4c76820
equal deleted inserted replaced
29009:c05cc1b95848 29010:e868d8ee7c8f
   262 		int shift = 0;
   262 		int shift = 0;
   263 
   263 
   264 		if (!next)
   264 		if (!next)
   265 			break;
   265 			break;
   266 
   266 
   267 		if (curr->a2 == next->a1)
   267 		if (curr->a2 == next->a1 || curr->b2 == next->b1)
   268 			while (curr->a2 + shift < an && curr->b2 + shift < bn
   268 			while (curr->a2 + shift < an && curr->b2 + shift < bn
   269 			       && !cmp(a + curr->a2 + shift,
   269 			       && !cmp(a + curr->a2 + shift,
   270 				       b + curr->b2 + shift))
   270 				       b + curr->b2 + shift))
   271 				shift++;
       
   272 		else if (curr->b2 == next->b1)
       
   273 			while (curr->b2 + shift < bn && curr->a2 + shift < an
       
   274 			       && !cmp(b + curr->b2 + shift,
       
   275 				       a + curr->a2 + shift))
       
   276 				shift++;
   271 				shift++;
   277 		if (!shift)
   272 		if (!shift)
   278 			continue;
   273 			continue;
   279 		curr->b2 += shift;
   274 		curr->b2 += shift;
   280 		next->b1 += shift;
   275 		next->b1 += shift;