minor optimization in puts: use inline putc_unlocked macro for newline
authorRich Felker <dalias@aerifal.cx>
Mon, 2 May 2011 00:12:51 +0000 (20:12 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 2 May 2011 00:12:51 +0000 (20:12 -0400)
src/stdio/puts.c

index 4c0e583..5a38a49 100644 (file)
@@ -4,7 +4,7 @@ int puts(const char *s)
 {
        int r;
        FLOCK(stdout);
 {
        int r;
        FLOCK(stdout);
-       r = -(fputs(s, stdout) < 0 || putchar('\n') < 0);
+       r = -(fputs(s, stdout) < 0 || putc_unlocked('\n', stdout) < 0);
        FUNLOCK(stdout);
        return r;
 }
        FUNLOCK(stdout);
        return r;
 }