Skip to content

Commit 33f3e27

Browse files
author
Amir Tocker
committed
Optimize synchronization
1 parent 3175dbb commit 33f3e27

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/src/main/java/com/cloudinary/android/UploadRequest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ public synchronized String dispatch() {
133133
}
134134

135135
private void verifyOptionsExist() {
136-
synchronized (optionsLockObject) {
137-
if (options == null) {
138-
options = new HashMap<>();
136+
if (options == null) {
137+
synchronized (optionsLockObject) {
138+
if (options == null) {
139+
options = new HashMap<>();
140+
}
139141
}
140142
}
141143
}

0 commit comments

Comments
 (0)