[Groonga-mysql-commit] mroonga/mroonga [master] Remove needless overflow check

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 25 00:20:51 JST 2012


Kouhei Sutou	2012-10-25 00:20:51 +0900 (Thu, 25 Oct 2012)

  New Revision: 044e97afbd3e58d74e9feee86f42c2533132f616
  https://github.com/mroonga/mroonga/commit/044e97afbd3e58d74e9feee86f42c2533132f616

  Log:
    Remove needless overflow check
    
    It is needed in GRN_TIME -> struct tm not struct tm -> GRN_TIME.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+1 -5)
===================================================================
--- ha_mroonga.cpp    2012-10-25 00:18:07 +0900 (b97c6e4)
+++ ha_mroonga.cpp    2012-10-25 00:20:51 +0900 (c0adfc0)
@@ -1507,13 +1507,9 @@ static int mrn_set_geometry(grn_ctx *ctx, grn_obj *buf,
 static long long int mrn_tm_to_grn_time(struct tm *time, int usec)
 {
   MRN_DBUG_ENTER_FUNCTION();
-  bool after_epoch_time =
-    (time->tm_year >= (UNIX_EPOCH_TIME_YEAR - TM_YEAR_BASE));
   long long int grn_time;
   long long int sec = mktime(time);
-  bool failed = (sec == -1);
-  bool overflowed = (after_epoch_time && sec < 0);
-  if (failed || overflowed) {
+  if (sec == -1) {
     grn_time = 0;
   } else {
     grn_time = GRN_TIME_PACK(sec + mrn_utc_diff_in_seconds, usec);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index