Skip to content

Commit 48af4cb

Browse files
authored
Re-use local variable to avoid extra FIRRemoteConfig accesses in RemoteConfigValueObservable (#14756)
1 parent d8143d7 commit 48af4cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigValueObservable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class RemoteConfigValueObservable<T: Decodable>: ObservableObject {
4545
do {
4646
let configValue: RemoteConfigValue = remoteConfig[key]
4747
if configValue.source == .remote || configValue.source == .default {
48-
self.configValue = try remoteConfig[key].decoded()
48+
self.configValue = try configValue.decoded()
4949
} else {
5050
self.configValue = fallbackValue
5151
}
@@ -66,7 +66,7 @@ class RemoteConfigValueObservable<T: Decodable>: ObservableObject {
6666
do {
6767
let configValue: RemoteConfigValue = remoteConfig[key]
6868
if configValue.source == .remote {
69-
self.configValue = try remoteConfig[key].decoded()
69+
self.configValue = try configValue.decoded()
7070
}
7171
} catch {
7272
// Suppresses a hard failure if decoding failed.

0 commit comments

Comments
 (0)