Skip to content

Commit fc1ebb8

Browse files
authored
Remove unused FIRFirestore instances dictionary (#2937)
This was copied into FSTFirestoreComponent but never removed.
1 parent 79e9fcd commit fc1ebb8

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

Firestore/Source/API/FIRFirestore.mm

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -72,45 +72,6 @@ @implementation FIRFirestore {
7272
FIRFirestoreSettings *_settings;
7373
}
7474

75-
+ (NSMutableDictionary<NSString *, FIRFirestore *> *)instances {
76-
static dispatch_once_t token = 0;
77-
static NSMutableDictionary<NSString *, FIRFirestore *> *instances;
78-
dispatch_once(&token, ^{
79-
instances = [NSMutableDictionary dictionary];
80-
});
81-
return instances;
82-
}
83-
84-
+ (void)initialize {
85-
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
86-
[center addObserverForName:kFIRAppDeleteNotification
87-
object:nil
88-
queue:nil
89-
usingBlock:^(NSNotification *_Nonnull note) {
90-
NSString *appName = note.userInfo[kFIRAppNameKey];
91-
if (appName == nil) return;
92-
93-
NSMutableDictionary *instances = [self instances];
94-
@synchronized(instances) {
95-
// Since the key for instances isn't just the app name, iterate over all the
96-
// keys to get the one(s) we have to delete. There could be multiple in case
97-
// the user calls firestoreForApp:database:.
98-
NSMutableArray *keysToDelete = [[NSMutableArray alloc] init];
99-
NSString *keyPrefix = [NSString stringWithFormat:@"%@|", appName];
100-
for (NSString *key in instances.allKeys) {
101-
if ([key hasPrefix:keyPrefix]) {
102-
[keysToDelete addObject:key];
103-
}
104-
}
105-
106-
// Loop through the keys found and delete them from the stored instances.
107-
for (NSString *key in keysToDelete) {
108-
[instances removeObjectForKey:key];
109-
}
110-
}
111-
}];
112-
}
113-
11475
+ (instancetype)firestore {
11576
FIRApp *app = [FIRApp defaultApp];
11677
if (!app) {

0 commit comments

Comments
 (0)