Re: sha1_to_hex() usage cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxx> 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 <torvalds@xxxxxxxx>
> ---
>
> 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.


-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]