1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 01:53:36 +02:00

Optimize it a bit - no need to dup empty string (which can be pretty common for .ini)

This commit is contained in:
Stanislav Malyshev
2001-01-08 20:13:32 +00:00
parent 77ebea3a6f
commit b06323cd6e

View File

@@ -92,7 +92,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, int callback_type, vo
new_property = (zval *) malloc(sizeof(zval));
INIT_PZVAL(new_property);
new_property->value.str.val = zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2));
new_property->value.str.val = Z_STRLEN_P(arg2)?zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)):"";
new_property->value.str.len = Z_STRLEN_P(arg2);
new_property->type = IS_STRING;