Skip to content

Commit

Permalink
Fix a possible concurrent modification
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Dec 29, 2023
1 parent 06fa122 commit 8ea1d1c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ public List<BakedQuad> getQuadsWithTexture(List<BakedQuad> quads, List<Sprite> t
for (BakedQuad quad : quads) {
Identifier sprite = quad.getSprite().getId();
if (separatedQuads.containsKey(sprite)) {
if (!separatedQuads.get(sprite).contains(quad))
separatedQuads.get(sprite).add(quad);
if (!separatedQuads.get(sprite).contains(quad)) {
List<BakedQuad> newQuadList = new ArrayList<>(separatedQuads.get(sprite));
newQuadList.add(quad);
separatedQuads.put(sprite, newQuadList);
}
continue;
}
List<BakedQuad> list = new ArrayList<>();
Expand Down

0 comments on commit 8ea1d1c

Please sign in to comment.