]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blobdiff - src/trackfds.h
Update copyright year.
[coloredstderr/coloredstderr.git] / src / trackfds.h
index 28b38fbf978b05d439434ddbf2502482525b3ba1..c75508677c267c98ca1a34e2bcb0d41ee277ec59 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Utility functions to track file descriptors.
  *
- * Copyright (C) 2013  Simon Ruderich
+ * Copyright (C) 2013-2014  Simon Ruderich
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -185,10 +185,6 @@ static void init_from_environment(void) {
             goto next;
         }
 
-        if (i == count) {
-            break;
-        }
-
         /* Replace ',' to null-terminate number for atoi(). */
         *x = 0;
 
@@ -406,7 +402,7 @@ inline static int tracked_fds_find(int fd) {
         return 0;
     }
 
-    if (fd < TRACKFDS_STATIC_COUNT) {
+    if (likely(fd < TRACKFDS_STATIC_COUNT)) {
         return tracked_fds[fd];
     }