File tree 1 file changed +6
-4
lines changed
Sources/SwiftCompilerPluginMessageHandling/JSON
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ func encodeToJSON(value: some Encodable) throws -> [UInt8] {
17
17
}
18
18
19
19
/// Intermediate representation for serializing JSON structure.
20
- private class JSONReference {
20
+ private final class JSONReference {
21
21
enum Backing {
22
22
case null
23
23
case trueKeyword
@@ -60,9 +60,11 @@ private class JSONReference {
60
60
backing = . array( arr)
61
61
}
62
62
63
- static let null : JSONReference = . init( backing: . null)
64
- static let trueKeyword : JSONReference = . init( backing: . trueKeyword)
65
- static let falseKeyword : JSONReference = . init( backing: . falseKeyword)
63
+ // nonisolated(unsafe) is fine for these properties because they represent primitives
64
+ // that are never modified.
65
+ nonisolated ( unsafe) static let null : JSONReference = . init( backing: . null)
66
+ nonisolated ( unsafe) static let trueKeyword : JSONReference = . init( backing: . trueKeyword)
67
+ nonisolated ( unsafe) static let falseKeyword : JSONReference = . init( backing: . falseKeyword)
66
68
67
69
@inline ( __always)
68
70
static func newArray( ) -> JSONReference {
You can’t perform that action at this time.
0 commit comments