]> granicus.if.org Git - php/commitdiff
We already have default collator available.
authorAndrei Zmievski <andrei@php.net>
Thu, 9 Feb 2006 23:23:02 +0000 (23:23 +0000)
committerAndrei Zmievski <andrei@php.net>
Thu, 9 Feb 2006 23:23:02 +0000 (23:23 +0000)
Zend/zend_operators.c

index ba5dab69222f82db9314e10ee4e0be07b7a58abb..884d0da224b6048e015ab497f2bc7b01c12aa4dd 100644 (file)
@@ -1462,8 +1462,6 @@ ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 T
        UErrorCode status = U_ZERO_ERROR;
        UCollator *col;
 
-       col = ucol_open(UG(default_locale), &status);
-
        zend_make_unicode_zval(op1, &op1_copy, &use_copy1);
        zend_make_unicode_zval(op2, &op2_copy, &use_copy2);
 
@@ -1474,7 +1472,7 @@ ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 T
                op2 = &op2_copy;
        }
 
-       result->value.lval = ucol_strcoll(col, op1->value.ustr.val, op1->value.ustr.len, op2->value.ustr.val, op2->value.ustr.len);
+       result->value.lval = ucol_strcoll(UG(default_collator), op1->value.ustr.val, op1->value.ustr.len, op2->value.ustr.val, op2->value.ustr.len);
        result->type = IS_LONG;
 
        if (use_copy1) {
@@ -1484,8 +1482,6 @@ ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 T
                zval_dtor(op2);
        }
 
-       ucol_close(col);
-
        return SUCCESS;
 }