Skip to content

Commit da46b09

Browse files
adam-fowlerslashmoktoso
authored
Add SpanAttributes.reserveCapacity (#199)
Co-authored-by: Moritz Lang <16192401+slashmo@users.noreply.github.com> Co-authored-by: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
1 parent 8ecd7a9 commit da46b09

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
xcuserdata/
77
.swiftpm
88
/Package.resolved
9+
.vscode/

Sources/Tracing/SpanProtocol.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,11 @@ extension SpanAttributes {
713713
public var isEmpty: Bool {
714714
self._attributes.isEmpty
715715
}
716+
717+
/// Reserves enough space to store the specified number of attributes.
718+
public mutating func reserveCapacity(_ minimumCapacity: Int) {
719+
self._attributes.reserveCapacity(minimumCapacity)
720+
}
716721
}
717722

718723
extension SpanAttributes {

0 commit comments

Comments
 (0)