in bencode.c's tr_bencMergeDicts(), call tr_bencDictReserve() so the target dict only has to alloc once to hold all of the source dict's entries.

This commit is contained in:
Jordan Lee 2012-12-09 21:36:51 +00:00
parent 9ddd7e0166
commit dd643537ae
1 changed files with 2 additions and 0 deletions

View File

@ -1552,6 +1552,8 @@ tr_bencMergeDicts (tr_benc * target, const tr_benc * source)
assert (tr_bencIsDict (target));
assert (tr_bencIsDict (source));
tr_bencDictReserve (target, sourceCount + tr_bencDictSize(target));
for (i=0; i<sourceCount; ++i)
{
const char * key;