mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-28 20:47:49 +01:00
don't use contains in List
still kinda slow but oh well
This commit is contained in:
@@ -5,6 +5,7 @@ import org.pcollections.PCollection;
|
||||
import org.pcollections.TreePMap;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
public record File(JObjectKey key, PCollection<JObjectKey> refsFrom, boolean frozen,
|
||||
long mode, long cTime, long mTime,
|
||||
@@ -46,6 +47,6 @@ public record File(JObjectKey key, PCollection<JObjectKey> refsFrom, boolean fro
|
||||
|
||||
@Override
|
||||
public Collection<JObjectKey> collectRefsTo() {
|
||||
return chunks().values().stream().toList();
|
||||
return Set.copyOf(chunks().values());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
// FIXME: Ideally this is two classes?
|
||||
@@ -62,6 +63,6 @@ public record JKleppmannTreeNode(JObjectKey key, PCollection<JObjectKey> refsFro
|
||||
case JKleppmannTreeNodeMetaFile file -> Stream.of(file.getFileIno());
|
||||
default -> throw new IllegalStateException("Unexpected value: " + meta());
|
||||
}
|
||||
).toList();
|
||||
).collect(Collectors.toUnmodifiableSet());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user