aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase
diff options
context:
space:
mode:
authorGravatar Benoit St-Pierre <bstpierre@google.com>2018-02-26 13:58:28 -0500
committerGravatar Benoit St-Pierre <bstpierre@google.com>2018-02-26 13:58:28 -0500
commit6f5eebb77fcc2c130e80e8fe74101385dc993949 (patch)
tree9b5410df42363402dfef0566c36a988628740798 /Firebase
parent34dd1dbfd96bde4fcde7f51a97ccacc149142317 (diff)
PR feedback
Diffstat (limited to 'Firebase')
-rw-r--r--Firebase/Core/FIRApp.m11
-rw-r--r--Firebase/Core/Private/FIRAppInternal.h2
2 files changed, 5 insertions, 8 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:@" "];
}
diff --git a/Firebase/Core/Private/FIRAppInternal.h b/Firebase/Core/Private/FIRAppInternal.h
index bbf0477..4b56728 100644
--- a/Firebase/Core/Private/FIRAppInternal.h
+++ b/Firebase/Core/Private/FIRAppInternal.h
@@ -142,7 +142,7 @@ typedef NSString *_Nullable (^FIRAppGetUIDImplementation)(void);
* @param library Name of the library
* @param version Version of the library
*/
-+ (void)registerLibrary:(nonnull NSString *)library withVersion:(nonnull NSString *)version \
++ (void)registerLibrary:(nonnull NSString *)library withVersion:(nonnull NSString *)version
NS_SWIFT_NAME(registerLibrary(_:version:));
/**