X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Ftrackfds.h;h=c75508677c267c98ca1a34e2bcb0d41ee277ec59;hb=f54cd101d750cb31f54081a41d6cb880a9199dba;hp=28b38fbf978b05d439434ddbf2502482525b3ba1;hpb=b950cdb79209e092d20d629bd1b0e9211647bd1e;p=coloredstderr%2Fcoloredstderr.git diff --git a/src/trackfds.h b/src/trackfds.h index 28b38fb..c755086 100644 --- a/src/trackfds.h +++ b/src/trackfds.h @@ -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]; }