[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1223036 - /subversion/trunk/subversion/libsvn_delta/xdelta.c

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Fri, 24 Feb 2012 10:31:19 +0000 (GMT)

stefan2_at_apache.org wrote:

>> +/* Return the smallest byte index at which positions left of A and B
>> differ
>> + * (A[-result] != B[-result]).  If no difference can be found in the first
>> + * MAX_LEN characters, MAX_LEN will be returned.
>> + */
>> +static apr_size_t
>> +reverse_match_length(const char *a, const char *b, apr_size_t max_len)
>> +{
>> +  apr_size_t pos = 0;
[...]
>> +  while (++pos <= max_len)
>> +    if (a[-pos] != b[-pos])
>> +      break;

This loop looks like it would breaks when the doc string has been satisfied
(A[-result] != B[-result]), IFF "result" were equal to "pos"...

>> +
>> +  return pos-1;
>> +}

... but then you return "pos-1".  That's wrong, isn't it?

- Julian
Received on 2012-02-24 11:31:55 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.