aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorShivansh <shiv4nsh@gmail.com>2016-09-04 12:39:26 +0100
committerSean Owen <sowen@cloudera.com>2016-09-04 12:39:26 +0100
commite75c162e9e510d74b07f28ccf6c7948ac317a7c6 (patch)
tree3d424bc7733e9d7ccca8e929e914ceeced4c8e19 /project
parent6b156e2fcf9c0c1ed0770a7ad9c54fa374760e17 (diff)
downloadspark-e75c162e9e510d74b07f28ccf6c7948ac317a7c6.tar.gz
spark-e75c162e9e510d74b07f28ccf6c7948ac317a7c6.tar.bz2
spark-e75c162e9e510d74b07f28ccf6c7948ac317a7c6.zip
[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 <shiv4nsh@gmail.com> Closes #14873 from shiv4nsh/SPARK-17308.
Diffstat (limited to 'project')
-rw-r--r--project/SparkBuild.scala7
1 files changed, 4 insertions, 3 deletions
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(