summaryrefslogtreecommitdiff
path: root/time64.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2013-01-17 02:52:45 -0500
committerAndy Dougherty <doughera@lafayette.edu>2013-01-17 10:32:59 -0500
commit55971e212352fca42631e1c6c7cadd0eb3affbd0 (patch)
tree71ba640eacf91278e848478d7aacd681008f30d3 /time64.c
parent9816f1212fba0148b8edf3072e3d0b121e313665 (diff)
downloadperl-55971e212352fca42631e1c6c7cadd0eb3affbd0.tar.gz
remove an useless null check in S_copy_little_tm_to_big_TM
All callers of S_copy_little_tm_to_big_TM pass a true variable src. Checking for null is pointless. On Win32 32 bit VC 2003 -O1 -GL, perl517.dll's .text section went from 0xCO13F to 0xC012F bytes long. It can be argued that the compiler should have figured this out on its own, but VC for whatever reason didn't. Also pretty the indenting and align the assignments. The null check blames to commit 806a119aef .
Diffstat (limited to 'time64.c')
-rw-r--r--time64.c51
1 files changed, 23 insertions, 28 deletions
diff --git a/time64.c b/time64.c
index 7b08d41d65..5ae5e7da5e 100644
--- a/time64.c
+++ b/time64.c
@@ -269,34 +269,29 @@ static int S_safe_year(Year year)
static void S_copy_little_tm_to_big_TM(const struct tm *src, struct TM *dest) {
- if( src == NULL ) {
- memset(dest, 0, sizeof(*dest));
- }
- else {
-# ifdef USE_TM64
- dest->tm_sec = src->tm_sec;
- dest->tm_min = src->tm_min;
- dest->tm_hour = src->tm_hour;
- dest->tm_mday = src->tm_mday;
- dest->tm_mon = src->tm_mon;
- dest->tm_year = (Year)src->tm_year;
- dest->tm_wday = src->tm_wday;
- dest->tm_yday = src->tm_yday;
- dest->tm_isdst = src->tm_isdst;
-
-# ifdef HAS_TM_TM_GMTOFF
- dest->tm_gmtoff = src->tm_gmtoff;
-# endif
-
-# ifdef HAS_TM_TM_ZONE
- dest->tm_zone = src->tm_zone;
-# endif
-
-# else
- /* They're the same type */
- memcpy(dest, src, sizeof(*dest));
-# endif
- }
+#ifdef USE_TM64
+ dest->tm_sec = src->tm_sec;
+ dest->tm_min = src->tm_min;
+ dest->tm_hour = src->tm_hour;
+ dest->tm_mday = src->tm_mday;
+ dest->tm_mon = src->tm_mon;
+ dest->tm_year = (Year)src->tm_year;
+ dest->tm_wday = src->tm_wday;
+ dest->tm_yday = src->tm_yday;
+ dest->tm_isdst = src->tm_isdst;
+
+# ifdef HAS_TM_TM_GMTOFF
+ dest->tm_gmtoff = src->tm_gmtoff;
+# endif
+
+# ifdef HAS_TM_TM_ZONE
+ dest->tm_zone = src->tm_zone;
+# endif
+
+#else
+ /* They're the same type */
+ memcpy(dest, src, sizeof(*dest));
+#endif
}