mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
simplify boolean expressions (#1130)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
54f84cc924
commit
912897cd35
@ -231,7 +231,7 @@ MP4::Tag::parseBool(const MP4::Atom *atom)
|
||||
{
|
||||
ByteVectorList data = parseData(atom);
|
||||
if(!data.isEmpty()) {
|
||||
bool value = data[0].size() ? data[0][0] != '\0' : false;
|
||||
bool value = !data[0].isEmpty() && data[0][0] != '\0';
|
||||
addItem(atom->name, value);
|
||||
}
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ List<Ogg::Page *> Ogg::Page::paginate(const ByteVectorList &packets,
|
||||
streamSerialNumber,
|
||||
pageIndex,
|
||||
continued,
|
||||
lastSplit && (lastPacketInList ? lastPacketCompleted : true),
|
||||
lastSplit && (!lastPacketInList || lastPacketCompleted),
|
||||
lastSplit && (containsLastPacket && lastPacketInList)));
|
||||
pageIndex++;
|
||||
continued = true;
|
||||
|
@ -63,9 +63,9 @@ PropertyMap Tag::properties() const
|
||||
map["COMMENT"].append(comment());
|
||||
if(!(genre().isEmpty()))
|
||||
map["GENRE"].append(genre());
|
||||
if(!(year() == 0))
|
||||
if(year() != 0)
|
||||
map["DATE"].append(String::number(year()));
|
||||
if(!(track() == 0))
|
||||
if(track() != 0)
|
||||
map["TRACKNUMBER"].append(String::number(track()));
|
||||
return map;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user