Skip to content

Commit

Permalink
Avoid computing join points when it's not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoeilers committed Jun 17, 2024
1 parent c4350bd commit 422c431
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/scala/rules/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ object executor extends ExecutionRules {
(Q: (State, Verifier) => VerificationResult)
: VerificationResult = {

// Find join point if it exists.
val jp: Option[SilverBlock] = edges.headOption.flatMap(edge => s.methodCfg.joinPoints.get(edge.source))
// If joining branches is enabled, find join point if it exists.
val jp: Option[SilverBlock] = if (s.moreJoins.id >= JoinMode.All.id) {
edges.headOption.flatMap(edge => s.methodCfg.joinPoints.get(edge.source))
} else {
None
}

(edges, jp) match {
case (Seq(), _) => Q(s, v)
Expand Down

0 comments on commit 422c431

Please sign in to comment.