Skip to content

Commit 6bc0aa3

Browse files
committed
Conditional compilation
1 parent 37c09c1 commit 6bc0aa3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,17 @@ final class HeartbeatStorage: HeartbeatStorageProtocol {
5151
// MARK: - Instance Management
5252

5353
/// Statically allocated cache of `HeartbeatStorage` instances keyed by string IDs.
54-
private nonisolated(unsafe) static var cachedInstances: [
55-
String: WeakContainer<HeartbeatStorage>
56-
] =
57-
[:]
54+
#if compiler(>=6)
55+
private nonisolated(unsafe) static var cachedInstances: [
56+
String: WeakContainer<HeartbeatStorage>
57+
] =
58+
[:]
59+
#else
60+
private static var cachedInstances: [
61+
String: WeakContainer<HeartbeatStorage>
62+
] =
63+
[:]
64+
#endif // compiler(>=6)
5865

5966
/// Used to synchronize concurrent access to the `cachedInstances` property.
6067
private static let instancesLock = NSLock()

0 commit comments

Comments
 (0)