Jump to content

Decorate-sort-undecorate idiom: Difference between revisions

re-marked as incorrect
(Undo revision 347745 by Petelomax (talk))
Tag: Undo
(re-marked as incorrect)
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

Cookies help us deliver our services. By using our services, you agree to our use of cookies.