From 722f8364601d2b6ee2439b42cd75750f6aac90ed Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 9 Jan 2021 14:59:53 +0100 Subject: [PATCH] micro-optimization: fputc (function) -> putc (macro/inline function) --- stagit-index.c | 2 +- stagit.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stagit-index.c b/stagit-index.c index bb0ad3c..5cf9053 100644 --- a/stagit-index.c +++ b/stagit-index.c @@ -41,7 +41,7 @@ xmlencode(FILE *fp, const char *s, size_t len) case '\'': fputs("'" , fp); break; case '&': fputs("&", fp); break; case '"': fputs(""", fp); break; - default: fputc(*s, fp); + default: putc(*s, fp); } } } diff --git a/stagit.c b/stagit.c index d38aaa4..98035e9 100644 --- a/stagit.c +++ b/stagit.c @@ -371,7 +371,7 @@ xmlencode(FILE *fp, const char *s, size_t len) case '\'': fputs("'", fp); break; case '&': fputs("&", fp); break; case '"': fputs(""", fp); break; - default: fputc(*s, fp); + default: putc(*s, fp); } } } @@ -552,12 +552,12 @@ printcommit(FILE *fp, struct commitinfo *ci) xmlencode(fp, ci->author->email, strlen(ci->author->email)); fputs(">\nDate: ", fp); printtime(fp, &(ci->author->when)); - fputc('\n', fp); + putc('\n', fp); } if (ci->msg) { - fputc('\n', fp); + putc('\n', fp); xmlencode(fp, ci->msg, strlen(ci->msg)); - fputc('\n', fp); + putc('\n', fp); } } @@ -676,7 +676,7 @@ printshowfile(FILE *fp, struct commitinfo *ci) fprintf(fp, "-", i, j, k, i, j, k); else - fputc(' ', fp); + putc(' ', fp); xmlencode(fp, line->content, line->content_len); if (line->old_lineno == -1 || line->new_lineno == -1) fputs("", fp); @@ -829,10 +829,10 @@ printcommitatom(FILE *fp, struct commitinfo *ci, const char *tag) xmlencode(fp, ci->author->email, strlen(ci->author->email)); fputs(">\nDate: ", fp); printtime(fp, &(ci->author->when)); - fputc('\n', fp); + putc('\n', fp); } if (ci->msg) { - fputc('\n', fp); + putc('\n', fp); xmlencode(fp, ci->msg, strlen(ci->msg)); } fputs("\n\n\n", fp); -- libgit2 1.1.1