Skip to content

Commit bd9272c

Browse files
authored
Fix perf assert macro (#8521)
1 parent d28849c commit bd9272c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

FirebasePerformance/Sources/Common/FPRDiagnostics.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ FOUNDATION_EXTERN void __FPRAssert(id object, BOOL condition, const char *func);
4343
// This assert adds additional functionality to the normal NSAssert, including printing out
4444
// information when NSAsserts are stripped. A __builtin_expect is utilized to keep running speed
4545
// as fast as possible.
46-
#define FPRAssert(condition, ...) \
47-
do { \
48-
__FPRAssert(self, !!(condition), __func__); \
49-
NSAssert(condition, __VA_ARGS__); \
50-
} while (0);
46+
#define FPRAssert(condition, ...) \
47+
{ \
48+
do { \
49+
__FPRAssert(self, !!(condition), __func__); \
50+
NSAssert(condition, __VA_ARGS__); \
51+
} while (0); \
52+
}
5153

5254
/** This class handles the control of diagnostics in the SDK. */
5355
@interface FPRDiagnostics : NSObject

FirebasePerformance/Tests/Unit/Common/FPRDiagnosticsTest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ - (void)testFPRAssertSpeed {
8080

8181
/** Tests that FPRAssert actually asserts (when NS_BLOCK_ASSERTIONS=0|undefined). */
8282
- (void)testFPRAssert {
83-
XCTAssertThrows({FPRAssert(NO, @"This is a failed assert!")});
83+
XCTAssertThrows(FPRAssert(NO, @"This is a failed assert!"));
8484
}
8585

8686
/** Tests emit diagnostics methods. */

0 commit comments

Comments
 (0)