[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgit
Subject:    [PATCH v2 2/8] ui-repolist: Remove conditional around print_header()
From:       Tim Nordell <tim.nordell () logicpd ! com>
Date:       2016-03-04 23:24:50
Message-ID: 1457133901-12998-3-git-send-email-tim.nordell () logicpd ! com
[Download RAW message or body]

The code has since morphed from the original use case of the
conditional for deciding whether or not to print the header.
This is guaranteed to always pass due to the earlier check
in the function "any_repos_visible()" which emits a 404
page.

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

diff --git a/ui-repolist.c b/ui-repolist.c
index 771b330..c240af3 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -272,7 +272,7 @@ static int sort_repolist(char *field)
 
 void cgit_print_repolist(void)
 {
-	int i, columns = 3, hits = 0, header = 0;
+	int i, columns = 3, hits = 0;
 	char *last_section = NULL;
 	char *section;
 	int sorted = 0;
@@ -301,6 +301,7 @@ void cgit_print_repolist(void)
 		sort_repolist("section");
 
 	html("<table summary='repository list' class='list nowrap'>");
+	print_header();
 	for (i = 0; i < cgit_repolist.count; i++) {
 		ctx.repo = &cgit_repolist.repos[i];
 		if (!is_visible(ctx.repo))
@@ -310,8 +311,6 @@ void cgit_print_repolist(void)
 			continue;
 		if (hits > ctx.qry.ofs + ctx.cfg.max_repo_count)
 			continue;
-		if (!header++)
-			print_header();
 		section = ctx.repo->section;
 		if (section && !strcmp(section, ""))
 			section = NULL;
-- 
2.4.9

_______________________________________________
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic