From 5ab594cf01c31b1ae89c0a3a584100a1d0798dab Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 7 Nov 2025 21:21:54 +0000 Subject: [PATCH] Optimize smart_str_append_scalar() for true/false There is no point in having both cases together just to branch on them again to figure out what to print. --- Zend/zend_smart_str.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Zend/zend_smart_str.c b/Zend/zend_smart_str.c index 501f6e6176c..c779ee5c97c 100644 --- a/Zend/zend_smart_str.c +++ b/Zend/zend_smart_str.c @@ -208,8 +208,11 @@ ZEND_API void ZEND_FASTCALL smart_str_append_scalar(smart_str *dest, const zval break; case IS_TRUE: + smart_str_appendl(dest, "true", sizeof("true")-1); + break; + case IS_FALSE: - smart_str_appends(dest, Z_TYPE_P(value) == IS_TRUE ? "true" : "false"); + smart_str_appendl(dest, "false", sizeof("false")-1); break; case IS_DOUBLE: