[pacman-dev] Pointless public/private functions
Throughout the libalpm and pacman code there's a lot of public functions that simply wrap a private function (maybe with some asserts). What's the point? Why not have the asserts in the private function and make the private function public reducing the number of function being called? Andrew
On Fri, Jul 27, 2007 at 03:27:03PM +0100, Andrew Fyfe wrote:
Throughout the libalpm and pacman code there's a lot of public functions that simply wrap a private function (maybe with some asserts). What's the point? Why not have the asserts in the private function and make the private function public reducing the number of function being called?
Maybe that's because all public functions were in alpm.c before, and then Dan moved them where they belong : http://projects.archlinux.org/git/?p=pacman.git;a=commit;h=64d36db5f45db1599... So I would also think these wrappers make little sense now, but not totally sure :)
Hello, Na Fri, Jul 27, 2007 at 04:36:42PM +0200, Xavier <shiningxc@gmail.com> pisal(a):
So I would also think these wrappers make little sense now, but not totally sure :)
a usual practice to omit sanity checks when calling the _foo() function. this speeds up the lib a bit. and the idea is right imho, since the user never calls the _foo() functions, just the foo() ones - VMiklos
participants (3)
-
Andrew Fyfe
-
VMiklos
-
Xavier