Skip to content

Commit a274f06

Browse files
authored
[Jaeger] Update preprocessor directives in Jaeger thrift code (#4349)
1 parent 533513f commit a274f06

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/Protocol/TBinaryProtocol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public override void WriteDouble(double d)
192192
WriteI64(BitConverter.DoubleToInt64Bits(d));
193193
}
194194

195-
#if NETSTANDARD2_1_OR_GREATER
195+
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
196196
public override void WriteBinary(ReadOnlySpan<byte> bytes)
197197
{
198198
WriteI32(bytes.Length);

src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/Protocol/TCompactProtocol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public override void WriteDouble(double d)
356356
Transport.Write(PreAllocatedBuffer, 0, 8);
357357
}
358358

359-
#if NETSTANDARD2_1_OR_GREATER
359+
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
360360
public override void WriteBinary(ReadOnlySpan<byte> bytes)
361361
{
362362
Int32ToVarInt((uint)bytes.Length, ref PreAllocatedVarInt);

src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/Protocol/TProtocol.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected virtual void Dispose(bool disposing)
143143

144144
public virtual void WriteString(string s)
145145
{
146-
#if NETSTANDARD2_1_OR_GREATER
146+
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
147147
if (s.Length <= 128)
148148
{
149149
Span<byte> buffer = stackalloc byte[256];
@@ -165,7 +165,7 @@ public virtual void WriteString(string s)
165165
}
166166
}
167167

168-
#if NETSTANDARD2_1_OR_GREATER
168+
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
169169
public abstract void WriteBinary(ReadOnlySpan<byte> bytes);
170170
#endif
171171

src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
* Enabled performance optimizations for .NET 6.0+ runtimes.
6+
([#4349](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4349))
7+
58
## 1.5.0-alpha.1
69

710
Released 2023-Mar-07

0 commit comments

Comments
 (0)