Skip to content

Commit f83fc4e

Browse files
committed
fixed closures
1 parent ed78da8 commit f83fc4e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Sources/OpenTelemetrySdk/Metrics/Stable/Exemplar/ExemplarReservoir.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,17 @@ public class RandomFixedSizedExemplarReservoir : FixedSizedExemplarReservoir {
121121

122122
static func createLong(clock: Clock, size : Int) -> RandomFixedSizedExemplarReservoir {
123123

124-
return RandomFixedSizedExemplarReservoir(clock: clock, size: size, mapAndResetCell: unsafeBitCast(ReservoirCell.getAndResetLong, to: ((ReservoirCell, [String: AttributeValue]) -> ImmutableLongExemplarData).self))
124+
return RandomFixedSizedExemplarReservoir(clock: clock, size: size, mapAndResetCell: { cell, attributes in
125+
cell.getAndResetLong(pointAttributes: attributes)
126+
})
125127

126128
}
127129

128130
static func createDouble(clock: Clock, size : Int) -> RandomFixedSizedExemplarReservoir {
129-
return RandomFixedSizedExemplarReservoir(clock: clock, size: size, mapAndResetCell: unsafeBitCast(ReservoirCell.getAndResetDouble, to: ((ReservoirCell, [String: AttributeValue]) -> ImmutableDoubleExemplarData).self))
131+
return RandomFixedSizedExemplarReservoir(clock: clock, size: size, mapAndResetCell: { cell, attributes in
132+
return cell.getAndResetDouble(pointAttributes: attributes)
133+
})
134+
130135

131136
}
132137

0 commit comments

Comments
 (0)