summaryrefslogtreecommitdiff
path: root/ext/dom/node.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-05-28 18:12:52 +0400
committerDmitry Stogov <dmitry@zend.com>2014-05-28 18:12:52 +0400
commit3419dc8c60d4539a817212b85bd43d6dcdd82c28 (patch)
tree60757faf2c3110e8144eac23107db281e92fe2e9 /ext/dom/node.c
parent2af311bea339544728d9bdfc1e1f4111f1189cd3 (diff)
downloadphp-git-3419dc8c60d4539a817212b85bd43d6dcdd82c28.tar.gz
Use new zend_hash API
Diffstat (limited to 'ext/dom/node.c')
-rw-r--r--ext/dom/node.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 25c8daee6f..a35139bcad 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -1724,18 +1724,15 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
tmp = zend_hash_str_find(ht, "namespaces", sizeof("namespaces")-1);
if (tmp && Z_TYPE_P(tmp) == IS_ARRAY) {
zval *tmpns;
- while ((tmpns = zend_hash_get_current_data(Z_ARRVAL_P(tmp)))) {
- if (Z_TYPE_P(tmpns) == IS_STRING) {
- zend_string *prefix;
- ulong idx;
+ zend_string *prefix;
- if (zend_hash_get_current_key(Z_ARRVAL_P(tmp),
- &prefix, &idx, 0) == HASH_KEY_IS_STRING) {
+ ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(tmp), prefix, tmpns) {
+ if (Z_TYPE_P(tmpns) == IS_STRING) {
+ if (prefix) {
xmlXPathRegisterNs(ctxp, prefix->val, Z_STRVAL_P(tmpns));
}
}
- zend_hash_move_forward(Z_ARRVAL_P(tmp));
- }
+ } ZEND_HASH_FOREACH_END();
}
xpathobjp = xmlXPathEvalExpression(xquery, ctxp);
@@ -1759,12 +1756,11 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
inclusive_ns_prefixes = safe_emalloc(zend_hash_num_elements(Z_ARRVAL_P(ns_prefixes)) + 1,
sizeof(xmlChar *), 0);
- while ((tmpns = zend_hash_get_current_data(Z_ARRVAL_P(ns_prefixes)))) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(ns_prefixes), tmpns) {
if (Z_TYPE_P(tmpns) == IS_STRING) {
inclusive_ns_prefixes[nscount++] = Z_STRVAL_P(tmpns);
}
- zend_hash_move_forward(Z_ARRVAL_P(ns_prefixes));
- }
+ } ZEND_HASH_FOREACH_END();
inclusive_ns_prefixes[nscount] = NULL;
} else {
php_error_docref(NULL TSRMLS_CC, E_NOTICE,