diff options
author | Benoit St-Pierre <bstpierre@google.com> | 2018-02-26 13:58:28 -0500 |
---|---|---|
committer | Benoit St-Pierre <bstpierre@google.com> | 2018-02-26 13:58:28 -0500 |
commit | 6f5eebb77fcc2c130e80e8fe74101385dc993949 (patch) | |
tree | 9b5410df42363402dfef0566c36a988628740798 /Firebase/Core/FIRApp.m | |
parent | 34dd1dbfd96bde4fcde7f51a97ccacc149142317 (diff) |
PR feedback
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:@" "]; } |