Hacker News new | ask | show | jobs
by saulpw 61 days ago
Usually it's used like:

   if max < min:
       min, max = max, min

   [... algorithm that requires min < max]
So your suggestion would be to have two versions of the algorithm in the two branches of the 'if'. This is significantly more complicated and may even be slower depending on lots of factors.