From: Junio C Hamano Date: Thu, 04 May 2006 00:36:57 GMT Subject: Re: sha1_to_hex() usage cleanup Message-ID: <7v1wvabp7a.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Linus Torvalds writes: > Somebody on the #git channel complained that the sha1_to_hex() thing uses > a static buffer which caused an error message to show the same hex output > twice instead of showing two different ones. > > That's pretty easily rectified by making it uses a simple LRU of a few > buffers, which also allows some other users (that were aware of the buffer > re-use) to be written in a more straightforward manner. > > Signed-off-by: Linus Torvalds > --- > > This is another throw-away patch of mine. Not a big deal, but since I > tried it, I might as well try to submit it and see if Junio agrees.. Makes sort of sense in that the callers still need to be aware of the magic 4 limit but as long as they are they do not have to worry about allocation/deallocation/copying. But is that kind of cheat maintainable? I dunno.