From: Tsuda Kageyu Date: Tue, 1 Nov 2016 07:03:15 +0000 (+0900) Subject: Remove a useless branch. X-Git-Tag: v1.12-beta-1~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb6d058ab93ffcfbe00878a3aba6ffc1ac7d3df6;p=taglib Remove a useless branch. longLength <= LONG_MAX is always true if sizeof(long) == sizeof(long long). --- 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(longLength); } else { - if(longLength <= LONG_MAX) { - // The atom has a 64-bit length, but it's actually a 31-bit value - length = static_cast(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) {