Skip to content

Commit

Permalink
Replace some if-statements with if-expressions (apple#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
translatenix committed Feb 16, 2024
1 parent 0405db8 commit 3b2feb4
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ abstract class CliCommand(protected val cliOptions: CliBaseOptions) {
/** The Project used by this command. */
protected val project: Project? by lazy {
if (cliOptions.noProject) {
return@lazy null
null
} else {
cliOptions.normalizedProjectFile?.let { loadProject(it) }
}
cliOptions.normalizedProjectFile?.let { loadProject(it) }
}

protected fun loadProject(projectFile: Path): Project {
Expand All @@ -103,10 +104,7 @@ abstract class CliCommand(protected val cliOptions: CliBaseOptions) {
}

private val projectSettings: Project.EvaluatorSettings? by lazy {
if (cliOptions.omitProjectSettings) {
return@lazy null
}
project?.settings
if (cliOptions.omitProjectSettings) null else project?.settings
}

protected val allowedModules: List<Pattern> by lazy {
Expand Down

0 comments on commit 3b2feb4

Please sign in to comment.