mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 15:56:27 +00:00
Only compute if absent/present if compute is not needed (locking opts)
This commit is contained in:
@@ -329,12 +329,6 @@ public class PlannedStructure {
|
||||
public IrisObject rotated(IrisJigsawPiece piece, IrisObjectRotation rotation) {
|
||||
String key = piece.getObject() + "-" + rotation.hashCode();
|
||||
|
||||
return objectRotationCache.compute(key, (k, v) -> {
|
||||
if (v == null) {
|
||||
return rotation.rotateCopy(data.getObjectLoader().load(piece.getObject()));
|
||||
}
|
||||
|
||||
return v;
|
||||
});
|
||||
return objectRotationCache.computeIfAbsent(key, (k) -> rotation.rotateCopy(data.getObjectLoader().load(piece.getObject())));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user