1 | static WebTree webTree_sortChildren(WebTree tree) { |
2 | sortList(tree.children, makeComparator(func(Pair<WebNode, WebTree> a, Pair<WebNode, WebTree> b) { |
3 | int i = stdCompare(web_text(a.a), web_text(b.a)); |
4 | if (i != 0) ret i; |
5 | ret stdCompare(web_text(a.b.node), web_text(b.b.node)); |
6 | })); |
7 | for (Pair<WebNode, WebTree> p : tree.children) |
8 | webTree_sortChildren(p.b); |
9 | ret tree; |
10 | } |
Began life as a copy of #1010249
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1010251 |
Snippet name: | webTree_sortChildren - sorts by (relation text, node text) - modifies original tree |
Eternal ID of this version: | #1010251/1 |
Text MD5: | 8eddc353bedd32be27bc6030ca4ef631 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-09-07 18:41:43 |
Source code size: | 398 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 380 / 424 |
Referenced in: | [show references] |