Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit c358f77

Browse files
authored
Merge pull request #6156 from justinvp/activitytracker_tostring
Avoid string concat array allocation in ActivityTracker
2 parents 2a0bdd5 + 1eede1b commit c358f77

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/mscorlib/src/System/Diagnostics/Eventing/ActivityTracker.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,7 @@ public static string Path(ActivityInfo activityInfo)
328328

329329
public override string ToString()
330330
{
331-
string dead = "";
332-
if (m_stopped != 0)
333-
dead = ",DEAD";
334-
return m_name + "(" + Path(this) + dead + ")";
331+
return m_name + "(" + Path(this) + (m_stopped != 0 ? ",DEAD)" : ")");
335332
}
336333

337334
public static string LiveActivities(ActivityInfo list)

0 commit comments

Comments
 (0)