]> git.cameronkatri.com Git - cgit.git/commitdiff
ui-log: Do not always emit decoration span
authorTim Nordell <tim.nordell@logicpd.com>
Fri, 26 Feb 2016 20:57:30 +0000 (14:57 -0600)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 12 May 2016 15:17:02 +0000 (17:17 +0200)
The decoration span does not need to be emited if there aren't
any decorations to show.  This modification saves slightly
on bandwidth.

Signed-off-by: Tim Nordell <tim.nordell@logicpd.com>
ui-log.c

index 0a3938bf97c581b92e5ba0576d8232fd78c32a3a..641a5b643f2b354d2b50636db8c591861eadac9e 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -61,6 +61,8 @@ void show_commit_decorations(struct commit *commit)
 
        buf[sizeof(buf) - 1] = 0;
        deco = get_name_decoration(&commit->object);
+       if (!deco)
+               return;
        html("<span class='decoration'>");
        while (deco) {
                if (starts_with(deco->name, "refs/heads/")) {