You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/12 12:57:20 UTC

[GitHub] [spark] LuciferYang commented on a change in pull request #30353: [SPARK-33431][CORE][SQL] Use Option.contains instead of instanceOfOption == Some(x)

LuciferYang commented on a change in pull request #30353:
URL: https://github.com/apache/spark/pull/30353#discussion_r522085873



##########
File path: core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
##########
@@ -665,7 +665,7 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
     try {
       // If no attempt is specified, or there is no attemptId for attempts, return all attempts
       attemptId
-        .map { id => app.attempts.filter(_.info.attemptId == Some(id)) }
+        .map { id => app.attempts.filter(_.info.attemptId.contains(id)) }

Review comment:
       mainly to reduce unnecessary object creation, if the readability is affected, it can be left unchanged




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org