Skip to content

Commit cf8b4dc

Browse files
committed
Clean up unecessarily complex code
1 parent f0eda12 commit cf8b4dc

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

Parse/src/main/java/com/parse/ParseUser.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,23 +1336,18 @@ public Task<Void> linkWithInBackground(
13361336
* @see ParseAuthenticationCallbacks
13371337
*/
13381338
public Task<Void> unlinkFromInBackground(final String authType) {
1339+
if (authType == null) {
1340+
return Task.forResult(null);
1341+
}
1342+
13391343
synchronized (mutex) {
1340-
if (authType == null) {
1344+
if (!getAuthData().containsKey(authType)) {
13411345
return Task.forResult(null);
13421346
}
1343-
return Task.<Void> forResult(null).continueWithTask(new Continuation<Void, Task<Void>>() {
1344-
@Override
1345-
public Task<Void> then(Task<Void> task) throws Exception {
1346-
synchronized (mutex) {
1347-
if (getAuthData().containsKey(authType)) {
1348-
putAuthData(authType, null);
1349-
return saveInBackground();
1350-
}
1351-
return Task.forResult(null);
1352-
}
1353-
}
1354-
});
1347+
putAuthData(authType, null);
13551348
}
1349+
1350+
return saveInBackground();
13561351
}
13571352

13581353
//endregion

0 commit comments

Comments
 (0)