[pacman-dev] alpm_list: missing quick access to last element

Georg Grabler ggrabler at gmail.com
Mon Mar 5 04:17:45 EST 2007

When i understood the current pacman code, there is a cycle check,
therefore i don't see a reason why ->last should not be provided.

Though, i don't completely understand when you build a linear depend
list why you should want to step backwards anyway, especially not in
Ss mode.

On 3/5/07, Aaron Griffin <aaronmgriffin at gmail.com> wrote:
> On 3/4/07, Jürgen Hötzel <juergen at hoetzel.info> wrote:
> > due the missing "last element hint" which speeded up the add operation
> > before aaron introduced the public alpm_list type two months ago. I
> > consider adding the "last element" member again. Any objections?
> Actually, that's probably a bad idea.  It's almost trivial to convert
> the list to a circular one.  Then alpm_list_last(foo) would just be
> foo->prev;
> There should never be a case when this would cause a problem (i.e.
> some sort of "scan backward until ->prev is null" function would only
> be useful in the case of bad design).
> _______________________________________________
> pacman-dev mailing list
> pacman-dev at archlinux.org
> http://www.archlinux.org/mailman/listinfo/pacman-dev

More information about the pacman-dev mailing list