Inspectopedia
 
2024.3

Convert Pair constructor to 'to' function

Info
New
Last modified: 03 December 2024

Reports a Pair constructor invocation that can be replaced with a to() infix function call.

Explicit constructor invocations may add verbosity, especially if they are used multiple times. Replacing constructor calls with to() makes code easier to read and maintain.

Example:

After the quick-fix is applied: