]> git.armaanb.net Git - stagit.git/commitdiff
micro-optimization: fputc (function) -> putc (macro/inline function)
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sat, 9 Jan 2021 13:59:53 +0000 (14:59 +0100)
committerArmaan Bhojwani <me@armaanb.net>
Thu, 8 Apr 2021 01:56:46 +0000 (21:56 -0400)
src/stagit-index.c
src/stagit.c

index ecdfbc1b52af277e462b69ae7f19158688a521b1..5454edb0a2fbae91e7cb0aa9944b2c185e5bd2ec 100644 (file)
@@ -43,7 +43,7 @@ xmlencode(FILE *fp, const char *s, size_t len)
                case '\'': fputs("&#39;" , fp); break;
                case '&':  fputs("&amp;",  fp); break;
                case '"':  fputs("&quot;", fp); break;
                case '\'': fputs("&#39;" , fp); break;
                case '&':  fputs("&amp;",  fp); break;
                case '"':  fputs("&quot;", fp); break;
-               default:   fputc(*s, fp);
+               default:   putc(*s, fp);
                }
        }
 }
                }
        }
 }
index 337529526ce83964a387f404e87e38a2cda322fe..93127ef9bb9dacbdbbf2508a1ea6d597058c68fa 100644 (file)
@@ -334,8 +334,11 @@ xmlencodeline(FILE *fp, const char *s, size_t len)
                case '\'': fputs("&#39;",  fp); break;
                case '&':  fputs("&amp;",  fp); break;
                case '"':  fputs("&quot;", fp); break;
                case '\'': fputs("&#39;",  fp); break;
                case '&':  fputs("&amp;",  fp); break;
                case '"':  fputs("&quot;", fp); break;
+<<<<<<< HEAD:src/stagit.c
                case '\r': break; /* ignore CR */
                case '\n': break; /* ignore LF */
                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);
                }
        }
                default:   putc(*s, fp);
                }
        }
@@ -554,12 +557,12 @@ printcommit(FILE *fp, struct commitinfo *ci)
                xmlencode(fp, ci->author->email, strlen(ci->author->email));
                fputs("</a>&gt;\n<b>Date:</b>   ", fp);
                printtime(fp, &(ci->author->when));
                xmlencode(fp, ci->author->email, strlen(ci->author->email));
                fputs("</a>&gt;\n<b>Date:</b>   ", fp);
                printtime(fp, &(ci->author->when));
-               fputc('\n', fp);
+               putc('\n', fp);
        }
        if (ci->msg) {
        }
        if (ci->msg) {
-               fputc('\n', fp);
+               putc('\n', fp);
                xmlencode(fp, ci->msg, strlen(ci->msg));
                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("&gt;\nDate:   ", fp);
                printtime(fp, &(ci->author->when));
                xmlencode(fp, ci->author->email, strlen(ci->author->email));
                fputs("&gt;\nDate:   ", fp);
                printtime(fp, &(ci->author->when));
-               fputc('\n', fp);
+               putc('\n', fp);
        }
        if (ci->msg) {
        }
        if (ci->msg) {
-               fputc('\n', fp);
+               putc('\n', fp);
                xmlencode(fp, ci->msg, strlen(ci->msg));
        }
        fputs("\n</content>\n</entry>\n", fp);
                xmlencode(fp, ci->msg, strlen(ci->msg));
        }
        fputs("\n</content>\n</entry>\n", fp);