com php-src: Use the new timelib function for comparing times: ext/date/php_date.c
| From: | Derick Rethans | Date: | Fri, 29 Jan 2016 14:28:11 +0000 |
| Subject: | com php-src: Use the new timelib function for comparing times: ext/date/php_date.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90799@lists.php.net to get a copy of this message | ||
Commit: 1a8682568834580b44c448f2e682c704eea626d4
Author: Derick Rethans <github@derickrethans.nl> Fri, 29 Jan 2016 15:28:11 +0100
Parents: 2aeef4e5390344115391607792dbf8b94b3ec459
Branches: PHP-5.6 PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1a8682568834580b44c448f2e682c704eea626d4
Log:
Use the new timelib function for comparing times
Changed paths:
M ext/date/php_date.c
Diff:
diff --git a/ext/date/php_date.c b/ext/date/php_date..c
index 4ef9547..d5d06f6 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -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)