]> granicus.if.org Git - php/commitdiff
Use the new timelib function for comparing times
authorDerick Rethans <github@derickrethans.nl>
Fri, 29 Jan 2016 14:28:11 +0000 (15:28 +0100)
committerDerick Rethans <github@derickrethans.nl>
Fri, 29 Jan 2016 14:28:11 +0000 (15:28 +0100)
ext/date/php_date.c

index 4ef954717d8399a2dff0ea62284e1c750e3bc3ea..d5d06f6b2778fdec1f54321d96726b163c16270d 100644 (file)
@@ -2196,19 +2196,7 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC)
                timelib_update_ts(o2->time, o2->time->tz_info);
        }
 
-       if (o1->time->sse == o2->time->sse) {
-               if (o1->time->f == o2->time->f) {
-                       return 0;
-               }
-
-               if (o1->time->sse < 0) {
-                       return (o1->time->f < o2->time->f) ? 1 : -1;
-               } else {
-                       return (o1->time->f < o2->time->f) ? -1 : 1;
-               }
-       }
-
-       return (o1->time->sse < o2->time->sse) ? -1 : 1;
+       return timelib_time_compare(o1->time, o2->time);
 }
 
 static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_DC)