From: Hiltjo Posthuma Date: Sat, 9 Jan 2021 13:59:53 +0000 (+0100) Subject: micro-optimization: fputc (function) -> putc (macro/inline function) X-Git-Url: https://git.armaanb.net/?p=stagit.git;a=commitdiff_plain;h=515bec49452f7691c022be27e2cf80c7e517cf41 micro-optimization: fputc (function) -> putc (macro/inline function) --- diff --git a/src/stagit-index.c b/src/stagit-index.c index ecdfbc1..5454edb 100644 --- a/src/stagit-index.c +++ b/src/stagit-index.c @@ -43,7 +43,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/src/stagit.c b/src/stagit.c index 3375295..93127ef 100644 --- a/src/stagit.c +++ b/src/stagit.c @@ -334,8 +334,11 @@ xmlencodeline(FILE *fp, const char *s, size_t len) case '\'': fputs("'", fp); break; case '&': fputs("&", fp); break; case '"': fputs(""", fp); break; +<<<<<<< HEAD:src/stagit.c case '\r': break; /* ignore CR */ case '\n': break; /* ignore LF */ +======= +>>>>>>> 722f836 (micro-optimization: fputc (function) -> putc (macro/inline function)):stagit.c default: putc(*s, fp); } } @@ -554,12 +557,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); } } @@ -827,10 +830,10 @@ printcommitatom(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)); } fputs("\n\n\n", fp);