Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

16
LINES

< > BotCompany Repo | #1028769 // lcPairsToFiles

JavaX fragment (include) [tags: use-pretranspiled]

Uses 11335K of libraries. Click here for Pure Java version (7799L/51K).

1  
static MultiSetMap<Int, S> lcPairsToFiles(LineCompCompressor lc) {
2  
  new MultiSetMap<Int, S> pairsToFile;
3  
  for (S file, L<Int> l : lc.finalEncodings)
4  
    for (int i : l)
5  
      if (i >= lc.nLiterals())
6  
        lcPairsToFiles_step(lc, pairsToFile, i, file);
7  
  ret pairsToFile;
8  
}
9  
  
10  
svoid lcPairsToFiles_step(LineCompCompressor lc, MultiSetMap<Int, S> pairsToFile, int i, S file) {
11  
  if (i < lc.nLiterals()) ret;
12  
  if (!pairsToFile.add(i, file)) ret;
13  
  IntPair p = lc.getPair(i);
14  
  lcPairsToFiles_step(lc, pairsToFile, p.a, file);
15  
  lcPairsToFiles_step(lc, pairsToFile, p.b, file);
16  
}

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: #1028769
Snippet name: lcPairsToFiles
Eternal ID of this version: #1028769/3
Text MD5: c08fcff276901702aada1c7e243c8939
Transpilation MD5: 519acc7aecf554d7eddbef7e316ff956
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-08 00:53:46
Source code size: 596 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 188 / 284
Version history: 2 change(s)
Referenced in: [show references]