From e75c162e9e510d74b07f28ccf6c7948ac317a7c6 Mon Sep 17 00:00:00 2001 From: Shivansh Date: Sun, 4 Sep 2016 12:39:26 +0100 Subject: [SPARK-17308] Improved the spark core code by replacing all pattern match on boolean value by if/else block. ## What changes were proposed in this pull request? Improved the code quality of spark by replacing all pattern match on boolean value by if/else block. ## How was this patch tested? By running the tests Author: Shivansh Closes #14873 from shiv4nsh/SPARK-17308. --- project/SparkBuild.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'project/SparkBuild.scala') diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index 83a7c0864f..d164ead4ba 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -212,9 +212,10 @@ object SparkBuild extends PomBuild { cachedFun(findFiles(scalaSource.in(config).value)) } - private def findFiles(file: File): Set[File] = file.isDirectory match { - case true => file.listFiles().toSet.flatMap(findFiles) + file - case false => Set(file) + private def findFiles(file: File): Set[File] = if (file.isDirectory) { + file.listFiles().toSet.flatMap(findFiles) + file + } else { + Set(file) } def enableScalaStyle: Seq[sbt.Def.Setting[_]] = Seq( -- cgit v1.2.3