mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +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)
|
int area(int height, int width)
|
||||||
{
|
{
|
||||||
Expects(height>0 && width>0); // good
|
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