Inspectopedia
 
2024.3

Can be replaced with lambda

Info
New
Last modified: 03 December 2024

Reports a function reference expression that can be replaced with a function literal (lambda).

Sometimes, passing a lambda looks more straightforward and more consistent with the rest of the code. Also, the fix might be handy if you need to replace a simple call with something more complex.

Example:

After the quick-fix is applied: