Skip to content

Commit 52198fc

Browse files
committed
py/misc: use __builtin_strcmp to enable compile-time optimization
1 parent 476c569 commit 52198fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/misc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ typedef struct {
299299
inline __attribute__((always_inline)) const char *MP_COMPRESSED_ROM_TEXT(const char *msg) {
300300
// "genhdr/compressed.data.h" contains an invocation of the MP_MATCH_COMPRESSED macro for each compressed string.
301301
// The giant if(strcmp) tree is optimized by the compiler, which turns this into a direct return of the compressed data.
302-
#define MP_MATCH_COMPRESSED(a, b) if (strcmp(msg, a) == 0) { return b; } else
302+
#define MP_MATCH_COMPRESSED(a, b) if (__builtin_strcmp(msg, a) == 0) { return b; } else
303303

304304
// It also contains a single invocation of the MP_COMPRESSED_DATA macro, we don't need that here.
305305
#define MP_COMPRESSED_DATA(x)

0 commit comments

Comments
 (0)