[PATCH] dpkg: create_list: zero terminate list in loop

Peter Korsgaard jacmet at uclibc.org
Fri Jun 6 08:12:46 UTC 2008


>>>>> "Robert" == Robert P J Day <rpjday at crashcourse.ca> writes:

Hi,

 Robert> you know, even though that saves a few bytes, i'd be tempted
 Robert> not to do it that way since it's just plain inefficient in
 Robert> terms of machine cycles -- constantly assigning NULL only to
 Robert> overwrite it during the next iteration.

That's hardly going to be measurable compared to the file I/O and
malloc/realloc stuff - Especially when you see that create_list is
only used on conffiles, E.G. files of typically only a few lines, and
it's only called twice doing an install/remove.

My bet is that most of the time will be spent on file I/O,
decompression and running pre/postinst scripts.

 Robert> IMHO, not worth the saved bytes to torture the logic that way.

I disagree.

-- 
Bye, Peter Korsgaard



More information about the busybox mailing list