Decorate-sort-undecorate idiom: Difference between revisions

Undo revision 347745 by Petelomax (talk)
(Undo revision 347745 by Petelomax (talk))
Tag: Undo
Line 623:
chrestomathy programming Rosetta Code site is a</pre>
 
{{incorrect|Lua|recalculates length on every comparison}}
However, for this same reason, there is no point doing the decorate, sort, undecorate in practice. You can simply do this:
<syntaxhighlight lang="lua">function lengthOrder (a, b)
7,820

edits