Github user squito commented on a diff in the pull request: https://github.com/apache/spark/pull/22612#discussion_r234337238 --- Diff: core/src/main/scala/org/apache/spark/executor/ExecutorMetrics.scala --- @@ -69,9 +67,8 @@ class ExecutorMetrics private[spark] extends Serializable { */ private[spark] def compareAndUpdatePeakValues(executorMetrics: ExecutorMetrics): Boolean = { var updated = false - - (0 until ExecutorMetricType.values.length).foreach { idx => - if (executorMetrics.metrics(idx) > metrics(idx)) { + ExecutorMetricType.metricToOffset.map { case (_, idx) => --- End diff -- minor, but i think foreach on a range is both more clear and more efficient here. You could do `(0 until ExecutorMetricType.numMetrics).foreach`
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org