static Map> lcRenumberTopLevelEncodings(LineCompCompressor lc, O... _) { ret lcRenumberTopLevelEncodings(lc.finalEncodings, _); } // out parameter: Map mapping (returns the forward mapping) static Map> lcRenumberTopLevelEncodings(Map> encodings, O... _) { new LinkedHashMap> out; new Map map; setOutParameter(_, mapping := map); for (S file, L l : encodings) { new L l2; for (int i : l) { Int j = map.get(i); if (j == null) map.put(i, j = l(map)+1); l2.add(j); } out.put(file, l2); } ret out; }