mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fix obscure precondition expression
This commit is contained in:
parent
6a14df3e51
commit
f1981f9e99
|
@ -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
|
||||
// ...
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user