From ae8d2fdc27774e3cf36d419309547eae34d3640c Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 3 Aug 2026 08:13:56 -0400 Subject: [PATCH] MT#55283 better optimise str_eq Change-Id: I0427dd5b0169fd85756ec8ffd222213ff4672643 --- lib/str.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/str.h b/lib/str.h index 722c9f0d3..07c3211bb 100644 --- a/lib/str.h +++ b/lib/str.h @@ -259,7 +259,7 @@ INLINE int str_cmp(const str *a, const char *b) { return str_cmp_len(a, b, strlen(b)); } INLINE bool str_eq(const str *a, const char *b) { - return str_cmp(a, b) == 0; + return strlen(b) == a->len && memcmp(a->s, b, a->len) == 0; } INLINE int str_cmp_str(const str *a, const str *b) { if (a->len < b->len)