reduce nesting of operator

Easier to read

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 2 years ago
parent f7de846909
commit 6ee4a168ca

@ -78,21 +78,14 @@ std::string AsfVideo::GUIDTag::to_string() {
} }
bool AsfVideo::GUIDTag::operator<(const GUIDTag& other) const { bool AsfVideo::GUIDTag::operator<(const GUIDTag& other) const {
if (data1_ < other.data1_) if (data1_ != other.data1_)
return true; return data1_ < other.data1_;
if (data1_ == other.data1_) { if (data2_ != other.data2_)
if (data2_ < other.data2_) return data2_ < other.data2_;
return true; if (data3_ != other.data3_)
if (data2_ == other.data2_) { return data3_ < other.data3_;
if (data3_ < other.data3_)
return true;
if (data3_ == other.data3_) {
return std::lexicographical_compare(data4_.begin(), data4_.end(), other.data4_.begin(), other.data4_.end()); return std::lexicographical_compare(data4_.begin(), data4_.end(), other.data4_.begin(), other.data4_.end());
} }
}
}
return false;
}
const AsfVideo::GUIDTag Header(0x75B22630, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}); const AsfVideo::GUIDTag Header(0x75B22630, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C});

Loading…
Cancel
Save