mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 00:15:35 +00:00
collapse single-entry probability collections to singletons
This commit is contained in:
parent
21ec335db9
commit
4dd43ea86d
@ -49,6 +49,14 @@ public class ProbabilityCollectionLoader implements TypeLoader<ProbabilityCollec
|
||||
}
|
||||
} else if(o instanceof List) {
|
||||
List<Map<Object, Object>> map = (List<Map<Object, Object>>) o;
|
||||
if(map.size() == 1) {
|
||||
Map<Object, Object> entry = map.get(0);
|
||||
if(entry.size() == 1) {
|
||||
for(Object value : entry.keySet()) {
|
||||
return new ProbabilityCollection.Singleton<>(configLoader.loadType(generic, value, depthTracker));
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < map.size(); i++) {
|
||||
Map<Object, Object> l = map.get(i);
|
||||
for(Entry<Object, Object> entry : l.entrySet()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user