Skip to content

Commit

Permalink
optimize checks
Browse files Browse the repository at this point in the history
Signed-off-by: Niranjan Artal <[email protected]>
  • Loading branch information
nartal1 committed Nov 3, 2023
1 parent a94e898 commit 3573d3e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ class QualificationAppInfo(
private def checkStageIdInExec(prev: Option[ExecInfo],
execInfo: ExecInfo, next: Option[ExecInfo]): (Seq[(Int, ExecInfo)], Option[ExecInfo]) = {
val associatedStages = {
if (execInfo.stages.size >= 1) {
if (execInfo.stages.nonEmpty) {
execInfo.stages.toSeq
} else {
if (prev.exists(_.stages.size >= 1)) {
if (prev.exists(_.stages.nonEmpty)) {
prev.flatMap(_.stages.headOption).toSeq
} else if (next.nonEmpty) {
} else if (next.exists(_.stages.nonEmpty)) {
next.flatMap(_.stages.headOption).toSeq
} else {
// we don't know what stage its in or its duration
Expand All @@ -223,7 +223,6 @@ class QualificationAppInfo(
}
}


private def getStageToExec(execInfos: Seq[ExecInfo]): (Map[Int, Seq[ExecInfo]], Seq[ExecInfo]) = {
val execsWithoutStages = new ArrayBuffer[ExecInfo]()

Expand Down

0 comments on commit 3573d3e

Please sign in to comment.