[pacman-dev] [PATCH] Remove alpm_dep_get_string usage from libalpm

Aaron Griffin aaronmgriffin at gmail.com
Mon Nov 19 13:36:55 EST 2007


On Nov 19, 2007 8:44 AM, Nagy Gabor <ngaba at bibl.u-szeged.hu> wrote:
> > 2. There is something in my mind about alpm_dep_getstring:
> > It shouldn't be used for debug preformat (or in libalpm at all); but that is
> > good for front-ends.
> > I would prefer the following more elegant(?) solution instead of switch():
> > there is a global const char *deptypestr[] = {">=", "<=", "="} in the
> > correct
> > order somewhere; and from now on, you can pass deptypestr[dep->mod]
> > parameter
> > easily to alpm_log for example (see alpm_depcmp). This is O(1) (<- switch is
> > also O(1), but that floods the code imho)
> > I will create a patch for this, after I can sync my git repo ;-)
> > Bye

Hmmm. I think I actually like the alpm_dep_get_string function. I
don't like the need to free the string afterwards, as it adds more
mental book keeping into the mix.

I'm a little torn here, as this patch is much less book keeping, but
is a little... erm ,uglier.

Anyone else have an opinion one way or the other?




More information about the pacman-dev mailing list