[glib] gdatetime: Remove an unnecessary NULL pointer check



commit b1cd3378fb107bb7807482298dbef361a591a084
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Jun 21 10:27:27 2014 +0100

    gdatetime: Remove an unnecessary NULL pointer check
    
    datetime->tz can never be NULL, so this pointer check is unnecessary and
    confusing, and messes up static analysis.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732000

 glib/gdatetime.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index 11e10e5..624d74e 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -2561,10 +2561,7 @@ g_date_time_format_locale (GDateTime   *datetime,
        case 'z':
          {
            gint64 offset;
-           if (datetime->tz != NULL)
-             offset = g_date_time_get_utc_offset (datetime) / USEC_PER_SECOND;
-           else
-             offset = 0;
+           offset = g_date_time_get_utc_offset (datetime) / USEC_PER_SECOND;
            if (!format_z (outstr, (int) offset, colons))
              return FALSE;
          }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]