79209507

Date: 2024-11-21 02:48:54
Score: 2
Natty:
Report link

You can based in the function argument, as example order parameter, define the operation that you want to do. Put an if to identify if the operation: is shortest do shortest action, if not, do the longest action. It will put some logic, but can help to avoid the function repetition and the same scope can be used.

Reasons:
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: SidHawks