Libraryless. Click here for Pure Java version (2235L/14K).
1 | // returns visited objects |
2 | // visitor may be null, then it's just about returning the set |
3 | static Set philosophyBot1_visitTrailsTree_gen(virtual PhilosophyBot1 engine, IVF1<O> visitor, O startingPoint) { |
4 | new Set seen; |
5 | philosophyBot1_visitTrailsTree_gen(engine, seen, visitor, startingPoint); |
6 | ret seen; |
7 | } |
8 | |
9 | svoid philosophyBot1_visitTrailsTree_gen(virtual PhilosophyBot1 engine, Set seen, IVF1<O> visitor, O startingPoint) { |
10 | if (startingPoint == null) ret; |
11 | |
12 | if (!seen.add(startingPoint)) ret; |
13 | visitor?.get(startingPoint); |
14 | |
15 | if (startingPoint cast Iterable) |
16 | for (O o : startingPoint) |
17 | philosophyBot1_visitTrailsTree_gen(engine, seen, visitor, o); |
18 | else if (startingPoint cast Map) |
19 | for (O o : values(startingPoint)) |
20 | philosophyBot1_visitTrailsTree_gen(engine, seen, visitor, o); |
21 | else |
22 | philosophyBot1_visitTrailsTree_gen(engine, seen, visitor, rcall getTrail(engine, startingPoint)); |
23 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027188 |
Snippet name: | philosophyBot1_visitTrailsTree_gen |
Eternal ID of this version: | #1027188/6 |
Text MD5: | 77faac35e6042bfb4ebd8e10b9305d4b |
Transpilation MD5: | 636b3c4e0c769759f6f5c9a923751a4e |
Author: | stefan |
Category: | |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-02-24 20:38:32 |
Source code size: | 940 bytes / 23 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 221 / 338 |
Version history: | 5 change(s) |
Referenced in: | [show references] |