emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r108914: * process.c: Avoid unnecessa


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108914: * process.c: Avoid unnecessary calls to gettime.
Date: Fri, 06 Jul 2012 09:57:32 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108914
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Fri 2012-07-06 09:57:32 -0700
message:
  * process.c: Avoid unnecessary calls to gettime.
  
  (wait_reading_process_output): Don't get the time of day
  when gobbling data immediately and not waiting, as there's no need
  for it in that case.  This removes a FIXME.
modified:
  src/ChangeLog
  src/process.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-07-06 15:46:51 +0000
+++ b/src/ChangeLog     2012-07-06 16:57:32 +0000
@@ -1,3 +1,10 @@
+2012-07-06  Paul Eggert  <address@hidden>
+
+       * process.c: Avoid unnecessary calls to gettime.
+       (wait_reading_process_output): Don't get the time of day
+       when gobbling data immediately and not waiting, as there's no need
+       for it in that case.  This removes a FIXME.
+
 2012-07-06  Jan Djärv  <address@hidden>
 
        * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3

=== modified file 'src/process.c'
--- a/src/process.c     2012-07-05 18:35:48 +0000
+++ b/src/process.c     2012-07-06 16:57:32 +0000
@@ -4307,7 +4307,7 @@
 
   /* Since we may need to wait several times,
      compute the absolute time to return at.  */
-  if (time_limit || nsecs) /* FIXME neither should be negative, no? */
+  if (time_limit || 0 < nsecs)
     {
       EMACS_GET_TIME (end_time);
       EMACS_SET_SECS_NSECS (timeout, time_limit, nsecs);
@@ -4336,13 +4336,13 @@
       /* Exit if already run out */
       if (nsecs < 0)
        {
-         /* -1 specified for timeout means
+         /* A negative timeout means
             gobble output available now
             but don't wait at all. */
 
          EMACS_SET_SECS_USECS (timeout, 0, 0);
        }
-      else if (time_limit || nsecs)
+      else if (time_limit || 0 < nsecs)
        {
          EMACS_GET_TIME (timeout);
          if (EMACS_TIME_LE (end_time, timeout))
@@ -4393,7 +4393,7 @@
              && requeued_events_pending_p ())
            break;
 
-         /* If time_limit is negative, we are not going to wait at all.  */
+         /* A negative timeout means do not wait at all.  */
          if (0 <= nsecs)
            {
              if (EMACS_TIME_VALID_P (timer_delay))
@@ -4661,7 +4661,7 @@
       do_pending_window_change (0);
 
       if ((time_limit || nsecs) && nfds == 0 && ! timeout_reduced_for_timers)
-       /* We wanted the full specified time, so return now.  */
+       /* We waited the full specified time, so return now.  */
        break;
       if (nfds < 0)
        {
@@ -6855,7 +6855,7 @@
     time_limit = TYPE_MAXIMUM (time_t);
 
   /* What does time_limit really mean?  */
-  if (time_limit || nsecs) /* FIXME: what if negative? */
+  if (time_limit || 0 < nsecs)
     {
       EMACS_GET_TIME (end_time);
       EMACS_SET_SECS_NSECS (timeout, time_limit, nsecs);
@@ -6886,13 +6886,13 @@
       /* Exit if already run out */
       if (nsecs < 0)
        {
-         /* -1 specified for timeout means
+         /* A negative timeout means
             gobble output available now
             but don't wait at all. */
 
          EMACS_SET_SECS_USECS (timeout, 0, 0);
        }
-      else if (time_limit || nsecs)
+      else if (time_limit || 0 < nsecs)
        {
          EMACS_GET_TIME (timeout);
          if (EMACS_TIME_LE (end_time, timeout))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]