From f20c332b3f607e5a2d40b5bb4f655deb9de9f47d Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sat, 26 Apr 2025 13:04:54 +0300 Subject: [PATCH] py/misc: use `__builtin_strcmp` to enable compile-time optimization (cherry picked from commit e2bba3cbbf0e02ccb0ae8f947c8fbbc3fe2593c8) --- py/misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/misc.h b/py/misc.h index e05fbe61a9d6d..257e80b86d7e5 100644 --- a/py/misc.h +++ b/py/misc.h @@ -306,7 +306,7 @@ typedef struct { inline MP_ALWAYSINLINE const char *MP_COMPRESSED_ROM_TEXT(const char *msg) { // "genhdr/compressed.data.h" contains an invocation of the MP_MATCH_COMPRESSED macro for each compressed string. // The giant if(strcmp) tree is optimized by the compiler, which turns this into a direct return of the compressed data. - #define MP_MATCH_COMPRESSED(a, b) if (strcmp(msg, a) == 0) { return b; } else + #define MP_MATCH_COMPRESSED(a, b) if (__builtin_strcmp(msg, a) == 0) { return b; } else // It also contains a single invocation of the MP_COMPRESSED_DATA macro, we don't need that here. #define MP_COMPRESSED_DATA(x)