@@ -55,7 +55,7 @@ public override ExportResult Export(in Batch<Activity> batch)
5555 if ( activity . TagObjects . Any ( ) )
5656 {
5757 this . WriteLine ( "Activity.Tags:" ) ;
58- foreach ( var tag in activity . TagObjects )
58+ foreach ( ref readonly var tag in activity . EnumerateTagObjects ( ) )
5959 {
6060 if ( tag . Key == SpanAttributeConstants . StatusCodeKey )
6161 {
@@ -96,10 +96,10 @@ public override ExportResult Export(in Batch<Activity> batch)
9696 if ( activity . Events . Any ( ) )
9797 {
9898 this . WriteLine ( "Activity.Events:" ) ;
99- foreach ( var activityEvent in activity . Events )
99+ foreach ( ref readonly var activityEvent in activity . EnumerateEvents ( ) )
100100 {
101101 this . WriteLine ( $ " { activityEvent . Name } [{ activityEvent . Timestamp } ]") ;
102- foreach ( var attribute in activityEvent . Tags )
102+ foreach ( ref readonly var attribute in activityEvent . EnumerateTagObjects ( ) )
103103 {
104104 if ( ConsoleTagTransformer . Instance . TryTransformTag ( attribute , out var result ) )
105105 {
@@ -112,7 +112,7 @@ public override ExportResult Export(in Batch<Activity> batch)
112112 if ( activity . Links . Any ( ) )
113113 {
114114 this . WriteLine ( "Activity.Links:" ) ;
115- foreach ( var activityLink in activity . Links )
115+ foreach ( ref readonly var activityLink in activity . EnumerateLinks ( ) )
116116 {
117117 this . WriteLine ( $ " { activityLink . Context . TraceId } { activityLink . Context . SpanId } ") ;
118118 foreach ( ref readonly var attribute in activityLink . EnumerateTagObjects ( ) )
0 commit comments