refactor: intern tr_torrent.bandwidth_group_ (#3000)

Most use cases involve either (a) using the default group or (b) sharing
a group with other torrents. In both cases, using a tr_quark is cheaper
than a std::string.
This commit is contained in:
Charles Kerr
2022-04-27 10:41:28 -05:00
committed by GitHub
parent a818ac9b13
commit 304fffa6b3
4 changed files with 19 additions and 12 deletions

View File

@@ -562,7 +562,7 @@ static void initField(tr_torrent const* const tor, tr_stat const* const st, tr_v
break;
case TR_KEY_group:
tr_variantInitStrView(initme, tor->group);
tr_variantInitStrView(initme, tor->bandwidthGroup().sv());
break;
case TR_KEY_hashString:
@@ -1162,7 +1162,7 @@ static char const* torrentSet(
if (std::string_view group; tr_variantDictFindStrView(args_in, TR_KEY_group, &group))
{
tor->setGroup(group);
tor->setBandwidthGroup(group);
}
if (errmsg == nullptr && tr_variantDictFindList(args_in, TR_KEY_labels, &tmp_variant))