Commits

Tim Gerundt committed ac0061a

Optimize merging list of differences. Give diff number instead of activating diff and letting code to determine active difference for every diff.

  • Participants
  • Parent commits c1f6eb2
  • Branches R2_14

Comments (0)

Files changed (1)

 	// Note we don't care about m_nDiffs count to become zero,
 	// because we don't rescan() so it does not change
 
-	SetCurrentDiff(lastDiff);
 	bool bGroupWithPrevious = false;
-	if (!ListCopy(srcPane, dstPane, -1, bGroupWithPrevious))
+	if (!ListCopy(srcPane, dstPane, lastDiff, bGroupWithPrevious))
 		return; // sync failure
 
 	// copy from bottom up is more efficient
 	{
 		if (m_diffList.IsDiffSignificant(i))
 		{
-			SetCurrentDiff(i);
 			// Group merge with previous (merge undo data to one action)
 			bGroupWithPrevious = true;
-			if (!ListCopy(srcPane, dstPane, -1, bGroupWithPrevious))
+			if (!ListCopy(srcPane, dstPane, i, bGroupWithPrevious))
 				return; // sync failure
 		}
 	}