Use std::max instead of conditional (#2562)

Found via clang-tidy.
This commit is contained in:
Andrew Gaul 2024-10-22 19:22:39 +09:00 committed by GitHub
parent b34e2711a7
commit 9c4fcbd050
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -142,9 +142,7 @@ static bool parse_write_blocks(const char* pstr, wbpart_list_t& wbparts, off_t&
std::cerr << "[ERROR] -p option parameter(" << pstr << ") is something wrong." << std::endl; std::cerr << "[ERROR] -p option parameter(" << pstr << ") is something wrong." << std::endl;
return false; return false;
} }
if(max_size < tmp_part.size){ max_size = std::max(max_size, tmp_part.size);
max_size = tmp_part.size;
}
wbparts.push_back(tmp_part); wbparts.push_back(tmp_part);
}else{ }else{
std::cerr << "[ERROR] -p option parameter(" << pstr << ") is something wrong." << std::endl; std::cerr << "[ERROR] -p option parameter(" << pstr << ") is something wrong." << std::endl;