Skip to content

Commit 90a2bf0

Browse files
committed
Remove scope loop and replace with call to containsAll
1 parent 2e85f50 commit 90a2bf0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

app/src/main/java/com/github/mobile/accounts/AccountAuthenticator.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ private boolean isValidAuthorization(final Authorization auth,
104104
if (scopes == null || scopes.size() != requiredScopes.size())
105105
return false;
106106

107-
for (String required : requiredScopes)
108-
if (!scopes.contains(required))
109-
return false;
110-
return true;
107+
return scopes.containsAll(requiredScopes);
111108
}
112109

113110
private Intent createLoginIntent(AccountAuthenticatorResponse response) {

0 commit comments

Comments
 (0)