clang-tidy: don't assign in if

Found with bugprone-assignment-in-if-condition

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2022-11-26 22:26:31 -08:00 committed by Urs Fleisch
parent 983a35f5ae
commit f40290dcaf

View File

@ -186,9 +186,13 @@ String ID3v2::Tag::genre() const
// the behavior the same as released versions it is being left with " ".
const FrameList &tconFrames = d->frameListMap["TCON"];
TextIdentificationFrame *f;
if(tconFrames.isEmpty() ||
!(f = dynamic_cast<TextIdentificationFrame *>(tconFrames.front())))
if(tconFrames.isEmpty())
{
return String();
}
TextIdentificationFrame *f = dynamic_cast<TextIdentificationFrame *>(tconFrames.front());
if(!f)
{
return String();
}