aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar davidair <davidair@users.noreply.github.com>2017-07-25 11:28:17 -0400
committerGravatar GitHub <noreply@github.com>2017-07-25 11:28:17 -0400
commitf7fc2bb573564aae1d5f0a9d4b354ea348e3a601 (patch)
tree0a5c8345265b8656297c842ef688dbb50db25491
parentf1fbbf3adb4c214df7f9128784d4e9a154dcc2d4 (diff)
Moving sMessageCodeRegex initialization into #ifdef DEBUG to remove the init cost, adding [FIRApp configure] to the Core example (#150)
-rw-r--r--Example/Core/App/iOS/FIRAppDelegate.m4
-rw-r--r--Firebase/Core/FIRLogger.m4
2 files changed, 7 insertions, 1 deletions
diff --git a/Example/Core/App/iOS/FIRAppDelegate.m b/Example/Core/App/iOS/FIRAppDelegate.m
index 0ecfdea..8819126 100644
--- a/Example/Core/App/iOS/FIRAppDelegate.m
+++ b/Example/Core/App/iOS/FIRAppDelegate.m
@@ -14,11 +14,13 @@
#import "FIRAppDelegate.h"
+@import FirebaseCommunity;
+
@implementation FIRAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
- // Override point for customization after application launch.
+ [FIRApp configure];
return YES;
}
diff --git a/Firebase/Core/FIRLogger.m b/Firebase/Core/FIRLogger.m
index df92eb6..92fc7b4 100644
--- a/Firebase/Core/FIRLogger.m
+++ b/Firebase/Core/FIRLogger.m
@@ -69,9 +69,11 @@ static BOOL sFIRAnalyticsDebugMode;
static FIRLoggerLevel sFIRLoggerMaximumLevel;
+#ifdef DEBUG
/// The regex pattern for the message code.
static NSString *const kMessageCodePattern = @"^I-[A-Z]{3}[0-9]{6}$";
static NSRegularExpression *sMessageCodeRegex;
+#endif
void FIRLoggerInitializeASL() {
dispatch_once(&sFIRLoggerOnceToken, ^{
@@ -112,8 +114,10 @@ void FIRLoggerInitializeASL() {
dispatch_set_target_queue(sFIRClientQueue,
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0));
+#ifdef DEBUG
sMessageCodeRegex =
[NSRegularExpression regularExpressionWithPattern:kMessageCodePattern options:0 error:NULL];
+#endif
});
}