]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/commitdiff
Remove unnecessary check in handle_*_pre().
authorSimon Ruderich <simon@ruderich.org>
Sat, 14 Sep 2013 22:10:45 +0000 (00:10 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sat, 14 Sep 2013 22:10:45 +0000 (00:10 +0200)
init_pre_post_string() sets both pre_string and post_string, so checking
only one suffices.

src/coloredstderr.c

index 4664f0d1a8d0efb033fb11bf28814fc4a730d12c..e6f1f6aab30999a2ecb55b017dfe4ae171658e95 100644 (file)
@@ -193,7 +193,7 @@ static void handle_fd_pre(int fd) {
 
     int saved_errno = errno;
 
-    if (unlikely(!pre_string || !post_string)) {
+    if (unlikely(!pre_string)) {
         init_pre_post_string();
     }
 
@@ -222,7 +222,7 @@ static void handle_file_pre(FILE *stream) {
 
     int saved_errno = errno;
 
-    if (unlikely(!pre_string || !post_string)) {
+    if (unlikely(!pre_string)) {
         init_pre_post_string();
     }