I'd be hesitant to say that running that calculation more than once per value is something "wrong" with the code--as was pointed out to me by jeroenes, for sorting a small number of elements, the Schwartzian doesn't buy you anything significant (especially for a cheap calculation like this one). Of course, if N gets larger, then the benefits of using it increase, so ++ for posting it: I just don't think it's necessarily called for here.
In reply to Re: Re: Re: Sorting strings
by ChemBoy
in thread Sorting strings
by rbi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |