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

Re: Status of the branch diff-optimizations-bytes branch

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Fri, 28 Jan 2011 16:10:01 +0000

Hyrum K Wright wrote:
> On Fri, Jan 28, 2011 at 6:49 AM, Johan Corveleyn <jcorvel_at_gmail.com> wrote:
> > And one more thing came to mind with regards to the new API
> > (datasources_open function): currently it only supports up to 4
> > datasources, so not an arbitrary number of datasources (the
> > implementation in diff_file.c assumes that anyway, because it has to
> > use some local array variables, so needs a fixed array length).
>
> I noticed these variables. It seems that we should get rid of the
> magic number ('4'), and replace it either with a sizeof() or a macro
> from somewhere. Not sure what the best approach is, but arbitrary
> numbers tickle my spidey sense.

I'm not looking at the code right now, but if it has multiple variables
each declared as an array[4], then a better way is usually to put all
the vars in a struct and have a single array of struct[4]. That's if
they make sense together and are all [4] for the same reason, of course.

- Julian
Received on 2011-01-28 17:14:28 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.