Libraryless. Click here for Pure Java version (2703L/17K).
1 | // first file is assumed to be LHS |
2 | static Map<S, LS> lcMergeStringsNotOccurringOnLHS(Map<S, LS> encodings) {
|
3 | Set<S> lhs = asSet(firstValue(encodings)); |
4 | ret mapValues(encodings, l -> {
|
5 | if (l == firstValue(encodings)) ret l; |
6 | l = cloneList(l); |
7 | int i = 0; |
8 | while (i < l(l)-1) {
|
9 | int j = i; |
10 | while (j < l(l) && !lhs.contains(l.get(j))) ++j; |
11 | if (j > i+1) |
12 | replaceSublist(l, i, j, ll(joinSubList(l, i, j))); |
13 | i++; |
14 | } |
15 | ret l; |
16 | }); |
17 | } |
Began life as a copy of #1028860
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: | #1028861 |
| Snippet name: | lcMergeStringsNotOccurringOnLHS [for linecomp] |
| Eternal ID of this version: | #1028861/1 |
| Text MD5: | d84ca5132e0df54682f461fa7cd90db7 |
| Transpilation MD5: | 989d4b54b586d27cb09c7ca052e8a9e3 |
| Author: | stefan |
| Category: | javax / linecomp |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-07-10 14:18:55 |
| Source code size: | 494 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 350 / 479 |
| Referenced in: | [show references] |