mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
(trunk libt) when generating json/benc strings, preallocate some space in the evbuffer to avoid excess realloc()s
This commit is contained in:
@@ -1580,6 +1580,7 @@ void
|
||||
tr_bencToBuf( const tr_benc * top, tr_fmt_mode mode, struct evbuffer * buf )
|
||||
{
|
||||
evbuffer_drain( buf, EVBUFFER_LENGTH( buf ) );
|
||||
evbuffer_expand( buf, 4096 ); /* alloc a little memory to start off with */
|
||||
|
||||
switch( mode )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user