Skip to content

Commit

Permalink
Apply code review suggestion, remove commented out code and prevent d…
Browse files Browse the repository at this point in the history
…ouble evaluation of associatedFile
  • Loading branch information
WojciechMazur committed Apr 12, 2024
1 parent 70523b7 commit 16795d6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions compiler/src/dotty/tools/dotc/profile/Profiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,7 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(using Context)
import java.lang.{Integer => jInt}
val reportNs = System.nanoTime()
val data = notification.getUserData
// val seq = notification.getSequenceNumber
// val message = notification.getMessage
val tpe = notification.getType
// val time= notification.getTimeStamp
data match {
case cd: CompositeData if tpe == "com.sun.management.gc.notification" =>
val name = cd.get("gcName").toString
Expand Down Expand Up @@ -318,8 +315,9 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(using Context)
if chromeTrace == null
then (TracedEventId.Empty, "")
else
val completionName= this.completionName(root, associatedFile)
val event = TracedEventId(associatedFile.name)
val file = associatedFile
val completionName= this.completionName(root, file)
val event = TracedEventId(file.name)
chromeTrace.traceDurationEventStart(Category.Completion.name, "", colour = "thread_state_sleeping")
chromeTrace.traceDurationEventStart(Category.File.name, event)
chromeTrace.traceDurationEventStart(Category.Completion.name, completionName)
Expand Down

0 comments on commit 16795d6

Please sign in to comment.