Fix missing objects when using multiple files

This commit is contained in:
Lonami Exo 2018-07-23 23:09:13 +02:00
parent 820c3bc83a
commit 2d442c390c
1 changed files with 1 additions and 2 deletions

View File

@ -14,11 +14,10 @@ public class TLReader {
public static void readTlObjects(final Map<String, List<TLObject>> result, final File file) { public static void readTlObjects(final Map<String, List<TLObject>> result, final File file) {
for (final Map.Entry<String, List<String>> entry : readTl(file).entrySet()) { for (final Map.Entry<String, List<String>> entry : readTl(file).entrySet()) {
final List<TLObject> objects = new ArrayList<>(); final List<TLObject> objects = result.computeIfAbsent(entry.getKey(), k -> new ArrayList<>());
for (final String string : entry.getValue()) { for (final String string : entry.getValue()) {
objects.add(TLObject.fromString(string)); objects.add(TLObject.fromString(string));
} }
result.put(entry.getKey(), objects);
} }
} }