diff options
Diffstat (limited to 'Firebase/Core/FIRApp.m')
-rw-r--r-- | Firebase/Core/FIRApp.m | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Firebase/Core/FIRApp.m b/Firebase/Core/FIRApp.m index d8ff75d..eed63b8 100644 --- a/Firebase/Core/FIRApp.m +++ b/Firebase/Core/FIRApp.m @@ -403,13 +403,9 @@ static NSMutableDictionary *sLibraryVersions; + (void)registerLibrary:(nonnull NSString *)library withVersion:(nonnull NSString *)version { // Create the set of characters which aren't allowed, only if this feature is used. - static NSCharacterSet *disallowedSet; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - NSMutableCharacterSet *allowedSet = [NSMutableCharacterSet alphanumericCharacterSet]; - [allowedSet addCharactersInString:@"-_."]; - disallowedSet = [allowedSet invertedSet]; - }); + NSMutableCharacterSet *allowedSet = [NSMutableCharacterSet alphanumericCharacterSet]; + [allowedSet addCharactersInString:@"-_."]; + NSCharacterSet *disallowedSet = [allowedSet invertedSet]; // Make sure the library name and version strings do not contain unexpected characters, and // add the name/version pair to the dictionary. if ([library rangeOfCharacterFromSet:disallowedSet].location == NSNotFound && @@ -433,6 +429,7 @@ static NSMutableDictionary *sLibraryVersions; [libraries addObject: [NSString stringWithFormat:@"%@/%@", libraryName, sLibraryVersions[libraryName]]]; } + [libraries sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; return [libraries componentsJoinedByString:@" "]; } |