Skip to content

Commit a89195f

Browse files
ref: use flatMap
1 parent 6a03690 commit a89195f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • src/main/java/cam72cam/mod/model/common/mesh

src/main/java/cam72cam/mod/model/common/mesh/Model.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ public void linkTextures(Map<String, NavigableMap<Integer, OBJTextureSheet>> tex
6868
this.speculars.putAll(spec);
6969
this.normals.putAll(norm);
7070
try {
71-
defaultLodSize = textures.values().stream().findFirst().get()
72-
.keySet().stream().mapToInt(i -> i).max().getAsInt();
73-
} catch (Throwable e) {
71+
defaultLodSize = textures.values().stream()
72+
.flatMap(m -> m.keySet().stream())
73+
.mapToInt(i -> i).max().getAsInt();
74+
} catch (NoSuchElementException e) {
7475
defaultLodSize = -1;
7576
}
7677
}

0 commit comments

Comments
 (0)