Skip to content

Commit

Permalink
IOSS: Use std::max
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Nov 5, 2024
1 parent 56e96f0 commit e5f7890
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 2 additions & 4 deletions packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.C
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,9 @@ namespace {
size_t max_face = std::string("Face Count").length();
for (auto &eb : ebs) {
const std::string &name = eb->name();
if (name.length() > max_name) {
max_name = name.length();
}
max_name = std::max(name.length(), max_name)
size_t face_width = Ioss::Utils::number_width(boundary_faces[name].size());
max_face = face_width > max_face ? face_width : max_face;
max_face = std::max(face_width, max_face);
}
max_name += 4; // Padding
max_face += 4;
Expand Down
4 changes: 1 addition & 3 deletions packages/seacas/libraries/ioss/src/main/cgns_decomp.C
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,7 @@ namespace {
for (const auto &zone : zones) {
if (zone->is_active()) {
auto len = zone->m_name.length();
if (len > name_len) {
name_len = len;
}
name_len = std::max(name_len, len);
}
}

Expand Down
6 changes: 2 additions & 4 deletions packages/seacas/libraries/ioss/src/main/skinner.C
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@ namespace {
size_t max_face = std::string("Face Count").length();
for (auto &eb : ebs) {
const std::string &name = eb->name();
if (name.length() > max_name) {
max_name = name.length();
}
max_name = std::max(max_name, name.length());
size_t face_width = Ioss::Utils::number_width(boundary_faces[name].size());
max_face = face_width > max_face ? face_width : max_face;
max_face = std::max(max_face, face_width);
}
max_name += 4; // Padding
max_face += 4;
Expand Down

0 comments on commit e5f7890

Please sign in to comment.