1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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.
This commit is contained in:
Gina Peter Banyard
2025-11-07 21:21:54 +00:00
parent ccda8b16d4
commit 5ab594cf01

View File

@@ -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: