diff options
author | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2016-11-01 16:03:15 +0900 |
---|---|---|
committer | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2016-11-01 16:03:15 +0900 |
commit | eb6d058ab93ffcfbe00878a3aba6ffc1ac7d3df6 (patch) | |
tree | c48db5ba6c4bf63544b6d24dbaf098024b3c00da /taglib/mp4 | |
parent | e6a69e24bcefdb7356139641a588c981c1952bc5 (diff) |
Remove a useless branch.
longLength <= LONG_MAX is always true if sizeof(long) == sizeof(long long).
Diffstat (limited to 'taglib/mp4')
-rw-r--r-- | taglib/mp4/mp4atom.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/taglib/mp4/mp4atom.cpp b/taglib/mp4/mp4atom.cpp index 6ea0cb62..5758173b 100644 --- a/taglib/mp4/mp4atom.cpp +++ b/taglib/mp4/mp4atom.cpp @@ -56,20 +56,15 @@ MP4::Atom::Atom(File *file) if(length == 1) { const long long longLength = file->readBlock(8).toLongLong(); - if(sizeof(long) == sizeof(long long)) { + if(longLength <= LONG_MAX) { + // The atom has a 64-bit length, but it's actually a 31-bit value or long is 64-bit. length = static_cast<long>(longLength); } else { - if(longLength <= LONG_MAX) { - // The atom has a 64-bit length, but it's actually a 31-bit value - length = static_cast<long>(longLength); - } - else { - debug("MP4: 64-bit atoms are not supported"); - length = 0; - file->seek(0, File::End); - return; - } + debug("MP4: 64-bit atoms are not supported"); + length = 0; + file->seek(0, File::End); + return; } } if(length < 8) { |