com php-src: avoid strlen usage in loop: ext/date/php_date. c
| From: | Anatol Belski | Date: | Sat, 20 Sep 2014 18:05:27 +0000 |
| Subject: | com php-src: avoid strlen usage in loop: ext/date/php_date. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81814@lists.php.net to get a copy of this message | ||
Commit: b9677d313d4c3e41282ad7e270a11a8891822437
Author: Anatol Belski <ab@php.net> Sat, 20 Sep 2014 20:05:27 +0200
Parents: 132cd8be0d13eaeee200cfa09b0596f6619c6a7e
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b9677d313d4c3e41282ad7e270a11a8891822437
Log:
avoid strlen usage in loop
Changed paths:
M ext/date/php_date.c
Diff:
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index a93afab..3fd4b27 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -4496,12 +4496,12 @@ PHP_FUNCTION(timezone_abbreviations_list)
do {
array_init(&element);
- add_assoc_bool(&element, "dst", entry->type);
- add_assoc_long(&element, "offset", entry->gmtoffset);
+ add_assoc_bool_ex(&element, "dst", sizeof("dst") -1, entry->type);
+ add_assoc_long_ex(&element, "offset", sizeof("offset") - 1,
entry->gmtoffset);
if (entry->full_tz_name) {
- add_assoc_string(&element, "timezone_id", entry->full_tz_name);
+ add_assoc_string_ex(&element, "timezone_id", sizeof("timezone_id") - 1,
entry->full_tz_name);
} else {
- add_assoc_null(&element, "timezone_id");
+ add_assoc_null_ex(&element, "timezone_id", sizeof("timezone_id") - 1);
}
abbr_array_p = zend_hash_str_find(HASH_OF(return_value), entry->name, strlen(entry->name));