Remove double negation
Remove double negation (
Why is this refactoring helpful?
Removing an unnecessary double negation simplifies the code.
What do I need to consider?
Removes conversion to boolean
Double negation changes a value into a boolean. Removing it can lead to a non-boolean value being used in expressions or assignments.
When conversion to boolean is needed, a more straightforward way for converting a value to boolean is
- Code Assist ID (for the configuration file):
- You can configure custom keyboard shortcuts with these code action kinds:
- This code assist provides refactoring suggestions. Learn how to configure the refactoring suggestion visibility.