Skip to content

Commit

Permalink
Use SIZE_MAX instead of -1 for size_t variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsorby committed Nov 21, 2024
1 parent 71f4154 commit bd0b2e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static const std::string FIXED_INDENT = " ";

void printComponent(const libcellml::ComponentPtr &component, size_t c, const std::string &indent, bool includeMaths)
{
if (c == size_t(-1)) {
if (c == SIZE_MAX) {
std::cout << "COMPONENT: '" << component->name() << "'";
} else {
std::cout << indent << "[" << c + 1 << "]: " << component->name();
Expand Down Expand Up @@ -162,7 +162,7 @@ void printComponent(const libcellml::ComponentPtr &component, size_t c, const st

void printComponent(const libcellml::ComponentPtr &component, bool includeMaths)
{
printComponent(component, -1, {}, includeMaths);
printComponent(component, SIZE_MAX, {}, includeMaths);
}

void printModel(const libcellml::ModelPtr &model, bool includeMaths)
Expand Down

0 comments on commit bd0b2e9

Please sign in to comment.