Further micro-optimization.
authorBruno Haible <bruno@clisp.org>
Wed, 6 Aug 2008 22:15:07 +0000 (00:15 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 6 Aug 2008 22:15:07 +0000 (00:15 +0200)
ChangeLog
lib/poll.c

index 0ab13226b1109cb38431a7448382b8d1d72a56f3..fdaff4ab63cd3d4c0d524cf1dbdcd818af66c05b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-06  Bruno Haible  <bruno@clisp.org>
+
+       * lib/poll.c (poll): Further micro-optimization.
+
 2008-08-06  Jim Meyering  <meyering@redhat.com>
 
        inet_pton.c: use locale-independent tolower
index 2138b812827f3ca9eb0514d90518863480c3d101..4a62dc1df1a8f06854b0e4635bc541600d132ea2 100644 (file)
@@ -55,7 +55,7 @@ poll (pfd, nfd, timeout)
      int timeout;
 {
   fd_set rfds, wfds, efds;
-  struct timeval tv = { 0, 0 };
+  struct timeval tv;
   struct timeval *ptv;
   int maxfd, rc;
   nfds_t i;
@@ -91,7 +91,11 @@ poll (pfd, nfd, timeout)
 
   /* convert timeout number into a timeval structure */
   if (timeout == 0)
-    ptv = &tv;
+    {
+      ptv = &tv;
+      ptv->tv_sec = 0;
+      ptv->tv_usec = 0;
+    }
   else if (timeout > 0)
     {
       ptv = &tv;