using sort to get the minimum value is far more expensive than it needs to be.While that's true, I think people overestimate the cost. For small lists, say up to a thousand items, it probably doesn't make much of a difference. It's like paying seven cents for a five cent candy bar. On the one hand, you're being overcharged by 40%. But a more useful way to look at it may be that you don't care because it's only two cents.
For another take on this, see here and here, for example.
In reply to Re: Using shift() on sort() and syntactical funniness
by Dominus
in thread Using shift() on sort() and syntactical funniness
by deprecated
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |