- if ((separator = strchr(Z_STRVAL_PP(entry), ';'))) {
- const char *ptr = separator;
-
- while (*++ptr && !PHP_HTTP_IS_CTYPE(digit, *ptr) && '.' != *ptr);
-
- quality = zend_strtod(ptr, NULL);
- identifier = estrndup(Z_STRVAL_PP(entry), ident_len = separator - Z_STRVAL_PP(entry));
- } else {
- quality = 1000.0 - i++;
- identifier = estrndup(Z_STRVAL_PP(entry), ident_len = Z_STRLEN_PP(entry));
- }
- freeme = identifier;
-
- while (PHP_HTTP_IS_CTYPE(space, *identifier)) {
- ++identifier;
- --ident_len;
- }
- while (ident_len && PHP_HTTP_IS_CTYPE(space, identifier[ident_len - 1])) {
- identifier[--ident_len] = '\0';
- }
-
- if ((selected = neg(identifier, &quality, supported TSRMLS_CC))) {
- /* don't overwrite previously set with higher quality */
- if (!zend_hash_exists(Z_ARRVAL(array), selected, strlen(selected) + 1)) {
- add_assoc_double(&array, selected, quality);
- }
- }
-
- efree(freeme);
+ if (key.key) {
+ add_assoc_double_ex(&arr, key.key->val, key.key->len, q);
+ } else {
+ add_index_double(&arr, key.h, q);