refactor: remove assigned-but-unused tr_info.originalName (#2276)
This commit is contained in:
parent
5096bbae9b
commit
bfbca961d4
|
@ -460,20 +460,13 @@ static char const* tr_metainfoParseImpl(
|
||||||
if (tr_variantDictFindStrView(d, TR_KEY_display_name, &sv))
|
if (tr_variantDictFindStrView(d, TR_KEY_display_name, &sv))
|
||||||
{
|
{
|
||||||
tr_free(inf->name);
|
tr_free(inf->name);
|
||||||
tr_free(inf->originalName);
|
|
||||||
inf->name = tr_strvDup(sv);
|
inf->name = tr_strvDup(sv);
|
||||||
inf->originalName = tr_strvDup(sv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inf->name == nullptr)
|
if (inf->name == nullptr)
|
||||||
{
|
{
|
||||||
inf->name = tr_strdup(inf->hashString);
|
inf->name = tr_strdup(inf->hashString);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inf->originalName == nullptr)
|
|
||||||
{
|
|
||||||
inf->originalName = tr_strdup(inf->hashString);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else // not a magnet link and has no info dict...
|
else // not a magnet link and has no info dict...
|
||||||
{
|
{
|
||||||
|
@ -510,9 +503,7 @@ static char const* tr_metainfoParseImpl(
|
||||||
}
|
}
|
||||||
|
|
||||||
tr_free(inf->name);
|
tr_free(inf->name);
|
||||||
tr_free(inf->originalName);
|
|
||||||
inf->name = tr_utf8clean(sv);
|
inf->name = tr_utf8clean(sv);
|
||||||
inf->originalName = tr_strdup(inf->name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* comment */
|
/* comment */
|
||||||
|
@ -655,7 +646,6 @@ void tr_metainfoFree(tr_info* inf)
|
||||||
tr_free(inf->creator);
|
tr_free(inf->creator);
|
||||||
tr_free(inf->source);
|
tr_free(inf->source);
|
||||||
tr_free(inf->torrent);
|
tr_free(inf->torrent);
|
||||||
tr_free(inf->originalName);
|
|
||||||
tr_free(inf->name);
|
tr_free(inf->name);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < inf->trackerCount; i++)
|
for (unsigned int i = 0; i < inf->trackerCount; i++)
|
||||||
|
|
|
@ -1589,10 +1589,6 @@ struct tr_info
|
||||||
/* total size of the torrent, in bytes */
|
/* total size of the torrent, in bytes */
|
||||||
uint64_t totalSize;
|
uint64_t totalSize;
|
||||||
|
|
||||||
/* The original name that came in this torrent's metainfo.
|
|
||||||
* CLIENT CODE: NOT USE THIS FIELD. */
|
|
||||||
char* originalName;
|
|
||||||
|
|
||||||
/* The torrent's name. */
|
/* The torrent's name. */
|
||||||
char* name;
|
char* name;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue