mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
Fix obscure precondition expression
This commit is contained in:
@@ -1094,7 +1094,7 @@ We don't need to mention it for each member function.
|
||||
int area(int height, int width)
|
||||
{
|
||||
Expects(height>0 && width>0); // good
|
||||
if (height>0 && width>0) my_error(); // obscure
|
||||
if (height<=0 || width<=0) my_error(); // obscure
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user