1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 18:18:10 +00:00

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

View file

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