Skip to content

Commit 6da8ca8

Browse files
committed
Simplify ScopeParser.parseScopes()
1 parent 36b819d commit 6da8ca8

File tree

1 file changed

+6
-7
lines changed
  • oauth2-server-core/src/main/java/nl/myndocs/oauth2/scope

1 file changed

+6
-7
lines changed

oauth2-server-core/src/main/java/nl/myndocs/oauth2/scope/ScopeParser.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ package nl.myndocs.oauth2.scope
33
object ScopeParser {
44
private const val SCOPE_SEPARATOR = " "
55

6-
fun parseScopes(scopes: String?): Set<String> {
7-
if (!scopes.isNullOrBlank()) {
8-
return scopes.split(SCOPE_SEPARATOR).toSet()
9-
}
10-
11-
return setOf()
12-
}
6+
fun parseScopes(scopes: String?): Set<String> =
7+
if (!scopes.isNullOrBlank())
8+
scopes
9+
.split(SCOPE_SEPARATOR)
10+
.toSet()
11+
else setOf()
1312
}

0 commit comments

Comments
 (0)