From c4cc3f2226e67300ea3cb40c67e4d619a5a9d45a Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 4 Jul 2010 21:59:30 +0000 Subject: Cache column sizes and char pointer into mdoc_bl. Finally get rid of the loops here and there to track down the MDOC_Column arguments. --- mdoc_html.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'mdoc_html.c') diff --git a/mdoc_html.c b/mdoc_html.c index 9f63019d..d8bad8d0 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.92 2010/07/02 12:54:33 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.93 2010/07/04 21:59:30 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -1074,7 +1074,7 @@ mdoc_it_head_pre(MDOC_ARGS, enum mdoc_list type, struct roffsu *width) static int mdoc_it_pre(MDOC_ARGS) { - int i, wp, comp; + int i, comp; const struct mdoc_node *bl, *nn; struct roffsu width, offs; enum mdoc_list type; @@ -1116,16 +1116,6 @@ mdoc_it_pre(MDOC_ARGS) if (bl->data.Bl->width) a2width(bl->data.Bl->width, &width); - wp = -1; - for (i = 0; bl->args && i < (int)bl->args->argc; i++) - switch (bl->args->argv[i].arg) { - case (MDOC_Column): - wp = i; /* Save for later. */ - break; - default: - break; - } - /* Override width in some cases. */ switch (type) { @@ -1149,8 +1139,8 @@ mdoc_it_pre(MDOC_ARGS) for (i = 0; nn && nn != n; nn = nn->next) if (MDOC_BODY == nn->type) i++; - if (i < (int)bl->args->argv[wp].sz) - a2width(bl->args->argv[wp].value[i], &width); + if (i < (int)bl->data.Bl->ncols) + a2width(bl->data.Bl->cols[i], &width); } if (MDOC_HEAD == n->type) -- cgit v1.2.3-56-ge451