Skip to content

Commit 16795d6

Browse files
committed
Apply code review suggestion, remove commented out code and prevent double evaluation of associatedFile
1 parent 70523b7 commit 16795d6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: compiler/src/dotty/tools/dotc/profile/Profiler.scala

+3-5
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,7 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(using Context)
234234
import java.lang.{Integer => jInt}
235235
val reportNs = System.nanoTime()
236236
val data = notification.getUserData
237-
// val seq = notification.getSequenceNumber
238-
// val message = notification.getMessage
239237
val tpe = notification.getType
240-
// val time= notification.getTimeStamp
241238
data match {
242239
case cd: CompositeData if tpe == "com.sun.management.gc.notification" =>
243240
val name = cd.get("gcName").toString
@@ -318,8 +315,9 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(using Context)
318315
if chromeTrace == null
319316
then (TracedEventId.Empty, "")
320317
else
321-
val completionName= this.completionName(root, associatedFile)
322-
val event = TracedEventId(associatedFile.name)
318+
val file = associatedFile
319+
val completionName= this.completionName(root, file)
320+
val event = TracedEventId(file.name)
323321
chromeTrace.traceDurationEventStart(Category.Completion.name, "", colour = "thread_state_sleeping")
324322
chromeTrace.traceDurationEventStart(Category.File.name, event)
325323
chromeTrace.traceDurationEventStart(Category.Completion.name, completionName)

0 commit comments

Comments
 (0)