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:33:03 UTC

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

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



##########
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:
       Hm, these all look like a performance non-sensitive code path. Is it worthwhile to sweep and fix? I am not sure because it will make more conflicts when reverting, backporting, etc. `Option == Some(id)` can be sort of more readable in a way.




----------------------------------------------------------------
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