Re: [PATCH] diff: optimise parse_dirstat_params() to only compare strings when necessary

2014-03-20 Thread Junio C Hamano
Dragos Foianu writes: > parse_dirstat_params() goes through a chain of if statements using > strcmp to parse parameters. When the parameter is a digit, the > value must go through all comparisons before the function realises > it is a digit. Optimise this logic by only going through the chain > o

Re: [PATCH] diff: optimise parse_dirstat_params() to only compare strings when necessary

2014-03-19 Thread Dragos Foianu
I will send another version of this patch after review because there is an extra whitespace following the else statement. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

[PATCH] diff: optimise parse_dirstat_params() to only compare strings when necessary

2014-03-19 Thread Dragos Foianu
parse_dirstat_params() goes through a chain of if statements using strcmp to parse parameters. When the parameter is a digit, the value must go through all comparisons before the function realises it is a digit. Optimise this logic by only going through the chain of string compares when the paramet