Replace assignment with return

Convert a variable assignment to a return statement.

Replace assignment with return

Inline return converts a variable assignment to a return statement. Such a conversion is possible when the following statement after the assignment in the control flow returns the variable.

This refactoring simplifies the control flow and makes it easier to reason about a function.

Configuration

Related Code Assists

Learn More

Available In