clang-tidy: simplify booleans

Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <[email protected]>
This commit is contained in:
Rosen Penev
2022-11-27 06:35:33 +01:00
committed by Urs Fleisch
parent bc5e56d3eb
commit 8c4d663393
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -237,10 +237,10 @@ bool MPEG::File::save(int tags, StripTags strip, ID3v2::Version version, Duplica
// Copy the values from the tag that does exist into the new tag,
// except if the existing tag is to be stripped.
if((tags & ID3v2) && ID3v1Tag() && !(strip == StripOthers && !(tags & ID3v1)))
if((tags & ID3v2) && ID3v1Tag() && (strip != StripOthers || (tags & ID3v1)))
Tag::duplicate(ID3v1Tag(), ID3v2Tag(true), false);
if((tags & ID3v1) && d->tag[ID3v2Index] && !(strip == StripOthers && !(tags & ID3v2)))
if((tags & ID3v1) && d->tag[ID3v2Index] && (strip != StripOthers || (tags & ID3v2)))
Tag::duplicate(ID3v2Tag(), ID3v1Tag(true), false);
}
+1 -1
View File
@@ -201,7 +201,7 @@ void RIFF::WAV::Properties::read(File *file)
d->sampleRate = data.toUInt(4, false);
d->bitsPerSample = data.toShort(14, false);
if(d->format != FORMAT_PCM && !(d->format == FORMAT_IEEE_FLOAT && totalSamples == 0))
if(d->format != FORMAT_PCM && (d->format != FORMAT_IEEE_FLOAT || totalSamples != 0))
d->sampleFrames = totalSamples;
else if(d->channels > 0 && d->bitsPerSample > 0)
d->sampleFrames = streamLength / (d->channels * ((d->bitsPerSample + 7) / 8));