X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=src%2Fphp_http_negotiate.c;h=9fdad26ff0e909041b45e9aec74e18dd6d77b6df;hp=d2410f88651a7d8014e9ad68560e6716a3983ef6;hb=d7d868e74c34f1e0e3c4564f5b351572aadb6454;hpb=57e944b102006abfa4005337b0ac5901425f4289 diff --git a/src/php_http_negotiate.c b/src/php_http_negotiate.c index d2410f8..9fdad26 100644 --- a/src/php_http_negotiate.c +++ b/src/php_http_negotiate.c @@ -14,13 +14,10 @@ static int php_http_negotiate_sort(const void *first, const void *second) { - zval result; Bucket *b1 = (Bucket *) first, *b2 = (Bucket *) second; + int result = numeric_compare_function(&b1->val, &b2->val); - if (numeric_compare_function(&result, &b1->val, &b2->val)!= SUCCESS) { - return 0; - } - return (Z_LVAL(result) > 0 ? -1 : (Z_LVAL(result) < 0 ? 1 : 0)); + return (result > 0 ? -1 : (result < 0 ? 1 : 0)); } #define M_PRI 5 @@ -156,7 +153,7 @@ HashTable *php_http_negotiate(const char *value_str, size_t value_len, HashTable zval_dtor(&arr); zend_hash_sort(result, php_http_negotiate_sort, 0); } - + return result; }