Skip to content

Commit

Permalink
terse decision on return value
Browse files Browse the repository at this point in the history
  • Loading branch information
daixtrose committed Oct 23, 2024
1 parent a9b012f commit a66fd93
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions polymorphism/test/include/test_polymorphism/mocking.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ struct Mock {
{
++numberOfCallsToCoolFeature;

if (0 != collectedSetArguments.size()) {
return collectedSetArguments.back();
} else {
return "<default value>";
}
return collectedSetArguments.empty()
? "<default value>"
: collectedSetArguments.back();
}

void set(std::string s)
Expand All @@ -30,4 +28,4 @@ struct Mock {

} // namespace mocking

#endif // POYMORPHISM_MOCKING_HPP
#endif // POLYMORPHISM_MOCKING_HPP

0 comments on commit a66fd93

Please sign in to comment.