Skip to content

Commit 4a92dda

Browse files
committed
chore(license-fact-providers): Use a bit more compact fallback code
Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 207f9bd commit 4a92dda

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

plugins/license-fact-providers/scancode/src/main/kotlin/ScanCodeLicenseFactProvider.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,10 @@ class ScanCodeLicenseFactProvider(
7575
return@lazy it
7676
} ?: logger.debug { "Could not locate the ScanCode 'licenses' text directory." }
7777

78-
FALLBACK_DIR.takeIf { it.isDirectory }.also {
79-
if (it == null) {
80-
logger.debug { "Could not locate fallback directory: $FALLBACK_DIR" }
81-
} else {
82-
logger.debug { "Located fallback ScanCode license text directory: $it" }
83-
return@lazy it
84-
}
85-
}
78+
FALLBACK_DIR.takeIf { it.isDirectory }?.also {
79+
logger.debug { "Located fallback ScanCode license text directory: $it" }
80+
return@lazy it
81+
} ?: logger.debug { "Could not locate fallback directory: $FALLBACK_DIR" }
8682

8783
logger.warn { "Could not locate any ScanCode license text directory." }
8884

0 commit comments

Comments
 (0)