In Google's diff_match_patch I found the following code:
best_common = shorttext.substring(j - suffixLength, j) +
shorttext.substring(j, j + prefixLength);
But isn't this the same as:
best_common = shorttext.substring(j - suffixLength, j + prefixLength);
?
If you want to see this code in it's natural habitat, please look at the source:
Look for line 673 and 674.