On Tue, Feb 14, 2012 at 01:49:11PM -0800, Junio C Hamano wrote: > static int scale_linear(int it, int width, int max_change) > { > + if (!it) > + return 0; > /* > - * make sure that at least one '-' is printed if there were deletions, > - * and likewise for '+'. > + * make sure that at least one '-' or '+' is printed if > + * there is any change to this path. The easiest way is to > + * scale linearly as if all the quantities were one smaller > + * than they actually are, and then add one to the result. > */ > if (max_change < 2) > - return it; > - return ((it - 1) * (width - 1) + max_change - 1) / (max_change - 1); > + return 1; > + return 1 + ((it - 1) * (width - 1) / (max_change - 1)); I'm not sure I understand why the "it - 1" and "max_change - 1" bits are still there, or what they are doing in the first place. I.e., why is it not simply "scale linearly to width-1, then add 1" as I posted earlier? -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html