[pacman-dev] [PATCH] Remove need to explicitly register the local DB
xyne at archlinux.ca
Sun Jan 30 11:46:22 EST 2011
Dan McGee wrote:
> The "register" code could just as well be done in the handle setup
> where I moved the call anyway. You'd save about 13 CPU cycles. It's
> design that is meant to remove stupidity in a library where you have
> to make what seems like a no-op call- but make sure you only do it
> once. Why let users shoot themselves in the foot? We already handled
> the teardown in alpm_release so this just makes the initialize side
> map that.
Xavier Chantry wrote:
> It's not separate logic. Dan commit log might have been a bit misleading.
> alpm_initialize initializes (wow) whatever is needed for the other
> functions to work. What we do there is just allocate some structures
> like the handle, and now handle->db_local as well. We are talking
> about one calloc and one strdup here to setup db_local. Really no big
> deal, there is no loading of the db, not even a check that one exists
> at all.
> And it does make it simpler for libalpm users. And as Dan said its
> symetric with alpm_release.
Ah. It makes much more sense now, especially given the symmetry with
> > -Dan
> > -Dan
> ^^ A sign I need my morning coffee... :)
I just assumed that you had graduated to Double Dan:
More information about the pacman-dev