com php-src: avoid usage of strlen() in the loop: ext/libxml/libxml.c
| From: | Anatol Belski | Date: | Sat, 13 Sep 2014 21:21:53 +0000 |
| Subject: | com php-src: avoid usage of strlen() in the loop: ext/libxml/libxml.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81548@lists.php.net to get a copy of this message | ||
Commit: 760c51a644c1870c82d3fa850216ecaefe844f86
Author: Anatol Belski <ab@php.net> Sat, 13 Sep 2014 21:44:40 +0200
Parents: a32e493d84c29035872ef72aa28093acbbcd486d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=760c51a644c1870c82d3fa850216ecaefe844f86
Log:
avoid usage of strlen() in the loop
Changed paths:
M ext/libxml/libxml.c
Diff:
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 8fd661c..8069466 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -1030,20 +1030,20 @@ static PHP_FUNCTION(libxml_get_errors)
zval z_error;
object_init_ex(&z_error, libxmlerror_class_entry);
- add_property_long(&z_error, "level", error->level);
- add_property_long(&z_error, "code", error->code);
- add_property_long(&z_error, "column", error->int2);
+ add_property_long_ex(&z_error, "level", sizeof("level") - 1,
error->level TSRMLS_CC);
+ add_property_long_ex(&z_error, "code", sizeof("code") - 1,
error->code TSRMLS_CC);
+ add_property_long_ex(&z_error, "column", sizeof("column") - 1,
error->int2 TSRMLS_CC);
if (error->message) {
- add_property_string(&z_error, "message", error->message);
+ add_property_string_ex(&z_error, "message", sizeof("message") - 1,
error->message TSRMLS_CC);
} else {
- add_property_stringl(&z_error, "message", "", 0);
+ add_property_stringl_ex(&z_error, "message", sizeof("message") - 1,
"", 0 TSRMLS_CC);
}
if (error->file) {
- add_property_string(&z_error, "file", error->file);
+ add_property_string_ex(&z_error, "file", sizeof("file") - 1,
error->file TSRMLS_CC);
} else {
- add_property_stringl(&z_error, "file", "", 0);
+ add_property_stringl_ex(&z_error, "file", sizeof("file") - 1,
"", 0 TSRMLS_CC);
}
- add_property_long(&z_error, "line", error->line);
+ add_property_long_ex(&z_error, "line", sizeof("line") - 1,
error->line TSRMLS_CC);
add_next_index_zval(return_value, &z_error);
error = zend_llist_get_next(LIBXML(error_list));