From: Brandon Casey Date: Wed, 06 Feb 2008 20:43:37 GMT Subject: Re: [PATCH] Make git prune remove temporary packs that look like write failures Message-ID: <47AA1BF9.5030803@nrlssc.navy.mil> In-Reply-To: David Tweed wrote: > On Feb 6, 2008 7:41 PM, Brandon Casey wrote: >> They use sprintf for the "%02x" part, but they use memcpy to copy the return >> of get_object_directory() into a fixed string and then append onto that, >> rather than repeatedly writing the same string over and over. Ok, there is one >> instance in builtin-prune.c that repeatedly writes path, but builtin-prune-packed.c >> does the memcpy thing. > >So I don't think efficiency is an issue. Yeah not performance critical, readability is definitely more important. I just don't like repeatedly doing: sprintf(dst, "static string %s", s) when the "static string" part doesn't change. Either way it doesn't make much difference here. -brandon