1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

preallocate a couple of dictionaries to the right size before using them.

This commit is contained in:
Jordan Lee 2012-12-09 21:28:20 +00:00
parent 0846d3f2ab
commit 9ddd7e0166
2 changed files with 3 additions and 1 deletions

View file

@ -77,6 +77,8 @@ tr_prefs_init_defaults (tr_benc * d)
if (!str)
str = tr_getDefaultDownloadDir ();
tr_bencDictReserve (d, 29);
tr_bencDictAddStr (d, PREF_KEY_DIR_WATCH, str);
tr_bencDictAddBool (d, PREF_KEY_DIR_WATCH_ENABLED, FALSE);

View file

@ -307,7 +307,7 @@ tr_sessionGetDefaultSettings (tr_benc * d)
{
assert (tr_bencIsDict (d));
tr_bencDictReserve (d, 60);
tr_bencDictReserve (d, 62);
tr_bencDictAddBool (d, TR_PREFS_KEY_BLOCKLIST_ENABLED, false);
tr_bencDictAddStr (d, TR_PREFS_KEY_BLOCKLIST_URL, "http://www.example.com/blocklist");
tr_bencDictAddInt (d, TR_PREFS_KEY_MAX_CACHE_SIZE_MB, DEFAULT_CACHE_SIZE_MB);