Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 381 Bytes

GCop544.md

File metadata and controls

19 lines (12 loc) · 381 Bytes

GCop 544

"It should be written as : SomeParameter = -SomeParameter"

Rule description

Negating a value is much simpler than normal multiplication because there is no need to perform any actual arithmetic. It also helps to improve your code readability.

Example

myInteger = myInteger * -1;

should be 🡻

myInteger = -myInteger;